I want to loop through a list of images in Matlab by unsing a loop. I want to get one Image at a time and turn it into a Matrix by using the imread function. Then I want to save each Matrix in a variable that is alphabetical and declared automatically in a separate loop.
myFolder = '/user/Matlab/projectfile/pictures';
filePattern = fullfile(myFolder, '*.bmp');
theFiles = dir(filePattern);
for k = 1 : length(theFiles)
baseFileName = theFiles(k).name;
fullFileName = fullfile(theFiles(k).folder, baseFileName);
imageArray = imread(fullFileName)
My problem is that I don't get the return. If I save my imageArray it only creates a Matrix of one image. But I need the program to save each Matrix within a unique Variable such as A,B,C,D... and so on. It should not matter how many pictures there are.
If anyone has a tipp for me I would be glad, thx :)