this is the code
clc; clear all; imdataPositive={}; imgPath = 'D:\EDU\Project\Images\'; dCell = dir([imgPath '*.jpg']); for a=1:length(dCell) baseFileName = dCell(a).name; fullFileName = fullfile(imgPath, baseFileName); imdataPositive{a} =imread(fullFileName); end %for a=1:length(dCell)
%imageNames = {imdataPositive{a}};
%end
numImages = numel(imdataPositive); emptyEntry = struct('image',[],'thumbnail',[]); imageCollection = repmat(emptyEntry,[1 numImages]); thumbnailSize = 400; for i = 1:numel(imageCollection) imageCollection(i).image = imread(imdataPositive{i}); imageCollection(i).thumbnail = imresize(imageCollection(i).image,... [thumbnailSize,thumbnailSize]); end figure; montage(cat(4,imageCollection.thumbnail)); title('Image Collection');
this is the error
??? Error using ==> strfind Input strings must have one row. Error in ==> imread at 329 if (strfind(filename, '://')) Error in ==> test2 at 19 imageCollection(i).image = imread(imdataPositive{i});
Best Answer