If you know the name of the directory in which they are located, or if you are connected to this directory, use dir to get a list of image names.
Now it's just a for loop to load images. Store images in an array of cells. For example...
D = dir('*.jpg'); imcell = cell(1,numel(D)); for i = 1:numel(D) imcell{i} = imread(D(i).name); end
CAUTION that these 100 images take up too much memory. For example, for a single 1Kx1K image, 3 megabytes will be required for storage if it is uint8 RGB. This may not seem like a huge amount.
But then 100 of these images will require 300 MB of RAM. The real problem arises if your operations with these images turn them into double ones, then they will now occupy 2.4 GB of memory. This quickly eats up the amount of RAM, especially if you are not using the 64-bit version of MATLAB.
user85109
source share