From: Krithika Mohan on
Hi,

I am trying to read a sequence of images, available in a folder.I have the following error when running the code

??? Subscripted assignment dimension mismatch.
Error in ==> imagesequencereading at 21
images(:,:,count)=tmp;

The following is the code that I used

%// list all the files in some folder
somefolder = '~Images\';
filelist = dir(somefolder);
images = [ ];

count = 1;
for k=3:size(filelist,1)
%// filelist is not a folder
if filelist(k).isdir ~= true
fname = filelist(k).name;
if strcmp( fname(size(fname,2)-3:size(fname,2)) ,'.tif') == 1
tmp = imread([somefolder fname]);
if size(tmp,3) == 3
tmp = rgb2gray(tmp);
%//Putting Images into buffer
images(:,:,count)=tmp;
count=count+1;
images = [images tmp];
disp([fname ' loaded']);
end
end
end
end
It looks to be correct for me , but I do not know how to debug this. Some Ps help.