f



CAT arguments dimensions are not consistent.

% read and show image
M = 30;
S=[]; 
% img matrix
figure();
for i=1:M
    str=strcat(int2str(i),'.jpg');    % concatenates two strings that form the name of the image
    eval('img=imread(str);');
    subplot(ceil(sqrt(M)),ceil(sqrt(M)),i);
    imshow(img);
    [irow icol]=size(img);    % get the number of rows (N1) and columns (N2)
    temp=reshape(img,irow*icol,1);    % creates a (N1*N2)x1 vector
    S=[S temp];    % S is a N1*N2xM matrix after finishing the sequence       
end; 

when i run this code it say:
??? Error using ==> horzcat
CAT arguments dimensions are not consistent.

Error in ==> test3 at 13
    S=[S temp];    % S is a N1*N2xM matrix after finishing the sequence

Any help please??
-1
Abhinay
3/2/2011 1:26:04 PM
comp.soft-sys.matlab 211079 articles. 13 followers. lunamoonmoon (258) is leader. Post Follow

1 Replies
4689 Views

Similar Articles

[PageSpeed] 27

"Abhinay " <abhilabh12@gmail.com> wrote in message <iklghc$qfm$1@fred.mathworks.com>...
>
> when i run this code it say:
> ??? Error using ==> horzcat
> CAT arguments dimensions are not consistent.
> 
> Error in ==> test3 at 13
>     S=[S temp];    % S is a N1*N2xM matrix after finishing the sequence
===============


In order for the command [S temp] to work S and temp need to have the same number of rows. MATLAB is complaining that they do not.
0
Matt
3/2/2011 2:05:07 PM
Reply: