errors in using RESHAPE FUNCTION......PLEASE HELP ME.

조회 수: 1 (최근 30일)
ajay kumar
ajay kumar 2014년 3월 5일
댓글: Anand 2014년 3월 5일
HI,
WHAT I HAVE DONE IS.
1.RED ONE IMAGE STOREDF AS IMAZE NAME=A;
2.RESIZE IT INTO 128*128 MANNER
3.I WANT THESE PIXEL ELEMTS IN SINGLE COLUMN
SO I CODED AS B=RESHAPE(A,C,D) WHERE C =128*128 AND D= 1
ERROR IS
z=reshape(a,c,d);
??? Error using ==> reshape
To RESHAPE the number of elements must not change.
PLEASE CORRECT ME?
BELOW IS CODE WHAT I HAVE DONE. a=imread('C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\Water lilies.jpg');
b=imresize(a,[128 128])
b=imresize(a,[128 128]);
c=128*128;
d=1;
z=reshape(a,c,d);

채택된 답변

Anand
Anand 2014년 3월 5일
b = imresize(a,[128 128]);
z = b(:);
  댓글 수: 3
ajay kumar
ajay kumar 2014년 3월 5일
thanks but z=b(:) meaning?
what i have to do if i want some n=3 colums and n=some rows..
z=reshape(b,c,d) not working gives same result
Anand
Anand 2014년 3월 5일
b has 128*128=16384 elements. You cannot reshape it so that it has 3 columns because 16384/3 is fractional. What is your end goal?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by