Convert to gray scale:
Filelist= dir('Clipboard*.png');
numberOfFiles = length(Filelist);
for k = 1 : numberOfFiles
thisImage = imread(Filelist(k).name);
[rows, columns, numberOfColorChannels] = size(thisImage);
if k == 1
I = zeros(rows, columns, numberOfFiles, class(thisImage));
end
if numberOfColorChannels > 1
I(:,:, k) = rgb2gray(thisImage);
else
I(:,:, k) = thisImage;
end
end
Best Answer