MATLAB: How to resize an image as per the required dimension

imresizeurgent

i am doing my final yr project on steganography. and my project s suit only for square matrix images. (i.e, 256*256 512*512 1024*1024) like that images. i need images for that. wen i tried to resize other images it does not works.
for eg., I=imread('post.jpg');
[m n] = size(I)
J = imresize(I, [256 256]);
[x y] = size(J)
the output i m getting is m = 324 n = 512
x = 256 y = 1156
i do not know why it is like this. i am not getting any errors. help me what to do what shall i do now? please help me its very urgent

Best Answer

Your image is 3 dimensional (RGB), not 2 dimensional.