Hello All,
I want to shift a (120,120) matrix spatially.I used the following program and got the final image shited along x, as in I am able to shift the data right and left.i am having trouble with shifting the data up and down.
clear all;
fid = fopen('Homo_noabs_S4D4.bin','r+');
A = fread(fid,'double');
a=reshape(A,120,120,120);
a=a(:,:,15);
figure,imagesc(a);
Y=a;
a=reshape(a,14400,1);
b=zeros(size(a));
for j=1:size(a(:))-3000
b(j)=a(j+3000);
end
size(b);
b=reshape(b,120,120);
figure,imagesc(b);
|
|
0
|
|
|
|
Reply
|
Aishwarya
|
7/20/2010 10:48:04 PM |
|
Aishwarya wrote:
> I want to shift a (120,120) matrix spatially.I used the following
> program and got the final image shited along x, as in I am able to shift
> the data right and left.i am having trouble with shifting the data up
> and down.
>
>
> clear all;
> fid = fopen('Homo_noabs_S4D4.bin','r+');
> A = fread(fid,'double');
> a=reshape(A,120,120,120);
> a=a(:,:,15);
> figure,imagesc(a);
> Y=a;
> a=reshape(a,14400,1);
> b=zeros(size(a));
> for j=1:size(a(:))-3000
> b(j)=a(j+3000);
> end
> size(b);
> b=reshape(b,120,120);
> figure,imagesc(b);
Have you considered using the optional arguments to imagesc() to specify the
positions of the corners of the images?
imagesc([1000 3000], [2000 4000], a)
would put the lower left corner at axes coordinates [1000, 2000] and would put
the upper right corner at axes coordinates [3000 4000]. (Not actually the
corners themselves, but for the precise details look at the documentation for
image() )
|
|
0
|
|
|
|
Reply
|
Walter
|
7/20/2010 11:00:10 PM
|
|
"Aishwarya " <icemails@yahoo.co.in> wrote in message <i25934$7bs$1@fred.mathworks.com>...
> Hello All,
>
> I want to shift a (120,120) matrix spatially.I used the following program and got the final image shited along x, as in I am able to shift the data right and left.i am having trouble with shifting the data up and down.
>
>
> clear all;
> fid = fopen('Homo_noabs_S4D4.bin','r+');
> A = fread(fid,'double');
> a=reshape(A,120,120,120);
> a=a(:,:,15);
> figure,imagesc(a);
> Y=a;
> a=reshape(a,14400,1);
> b=zeros(size(a));
> for j=1:size(a(:))-3000
> b(j)=a(j+3000);
> end
> size(b);
> b=reshape(b,120,120);
> figure,imagesc(b);
If you have the image processing toolbox you could use my tool:
http://www.mathworks.com/matlabcentral/fileexchange/27251-imtranslate
|
|
0
|
|
|
|
Reply
|
Sean
|
7/21/2010 1:59:06 PM
|
|
|
2 Replies
340 Views
(page loaded in 0.04 seconds)
Similiar Articles: Shift matrix in y direction - comp.soft-sys.matlabHello All, I want to shift a (120,120) matrix spatially.I used the following program and got the final image shited along x, as in I am able to shi... how we plot two dimensional dirac delta function - comp.soft-sys ...Shift matrix in y direction - comp.soft-sys.matlab how we plot two dimensional dirac delta function - comp.soft-sys ... Shift matrix in y direction - comp.soft-sys.matlab ... fast angle calculation between 2D vectors - comp.soft-sys.matlab ...Shift matrix in y direction - comp.soft-sys.matlab Re: fast angle calculation between 2D vectors - comp.soft-sys ... On Feb 10, 1:05=A0am, "Jan Simon" <matlab.THIS_Y ... Use of MATLAB fftshift - comp.dspShift matrix in y direction - comp.soft-sys.matlab Use of MATLAB fftshift - comp.dsp... The lacking ifftshift is a circular shift by half the ... issue is partly that it ... Applying HOG to optical flow between two frames - comp.soft-sys ...... are of size (nxm)) indicating the direction of motion in both x and y direction, but i need to represent them as only one matrix ... from AM signal without phase shift ... what is the fastest/lowest complexity way of computing variance or ...... need to compute the variance of a 8x8 data matrix as ... of size 8) 3. compute moving average along Y direction. ... Compute the mean: N adds + 1 divide or shift (shift by ... How to set x and y limits for pan and zoom for LINE function ...... to get envelope from AM signal without phase shift ... and excepted transfer function ... in the x direction: s(t,x,y ... This MATLAB function displays matrix ... You cannot ... opengl math - comp.graphics.api.opengl... WIDTH >> 1; // This is a binary shift to ... vNewView; > > // Get the view vector (The direction we ... This is a bit more complex, but it is modifying a matrix ... glDrawPixel - what is missing here? - comp.graphics.api.opengl ...Do you want to shift the whole picture withing the ... and require an offset of 10 pixels in the x and y directions. ... you could also have manipulated the GL_TEXTURE matrix ... Converting from Y-m-d h:m:s - comp.protocols.time.ntp... living from 1970 to now has experienced. 86400*((Y ... is really quite trivial, while the opposite direction is ... Mask will now be in the (mask_t) -2 to 9 range, a shift ... Shift matrix in y direction - comp.soft-sys.matlab | Computer GroupHello All, I want to shift a (120,120) matrix spatially.I used the following program and got the final image shited along x, as in I am able to shi... Shift matrix in y direction - Newsreader - MATLAB CentralHello All, I want to shift a (120,120) matrix spatially.I used the following program and got the final image shited along x, as in I am able to shift the data right ... 7/29/2012 7:21:06 AM
|