i have 2429 images in pgm format. each is in 19*19 size. Now i need to read all the images one by one and store in single matrix. With the help of previous mathworks available examples i read my file. now how to store in single matrix.
myFolder = 'C:\Users\smanohar\Documents\MATLAB\RBMimplementation\Gaussian RBM\gdrbm\greyscsalegdrbm\face';if ~isdir(myFolder)errorMessage = sprintf('Error: The following folder does not exist:\n%s', myFolder);uiwait(warndlg(errorMessage));return;endfilePattern = fullfile(myFolder, '*.pgm');jpegFiles = dir(filePattern);for k = 1:length(jpegFiles)baseFileName = jpegFiles(k).name;fullFileName = fullfile(myFolder, baseFileName);fprintf(1, 'Now reading %s\n', fullFileName);imageArray = imread(fullFileName);end
Best Answer