error in for loop

6 Ansichten (letzte 30 Tage)
Pat
Pat am 27 Apr. 2012
I have a code
for x = 1:length(dirlist)
im = imread([pathname, dirlist(x).name]);
W=imresize(im,[12 10])
Q(x)=W(:)
end
i am getting the error as
In an assignment A(:) = B, the number of elements in A and B must be the same.
Error in ==> sa at 14 W(x)=W(:)
W(:) will give 120x1 matrix i like to save all these values in a new matriix Q,i have 10 images in my dataset,so i need out put in Q as 120x10 for all those 10 images
please help

Akzeptierte Antwort

Daniel Shub
Daniel Shub am 27 Apr. 2012
Q(:, x) = W(:);
  3 Kommentare
Daniel Shub
Daniel Shub am 27 Apr. 2012
If the problem is solved please accept my answer. If the problem was not solved, but my answer was helpful, please vote for it.
Andrei Bobrov
Andrei Bobrov am 27 Apr. 2012
+1

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Convert Image Type finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by