error in for loop

1 次查看(过去 30 天)
Pat
Pat 2012-4-27
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

采纳的回答

Daniel Shub
Daniel Shub 2012-4-27
Q(:, x) = W(:);
  3 个评论
Daniel Shub
Daniel Shub 2012-4-27
If the problem is solved please accept my answer. If the problem was not solved, but my answer was helpful, please vote for it.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Convert Image Type 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by