简体   繁体   中英

image array in matlab

I'm trying to create an image array and save it into a variable called manosData. I already tried this code

myFolder = 'C:\MATLAB\fotos';
filePattern = fullfile(myFolder, '*.jpg');
jpegFiles = dir(filePattern);

manosData = cell(1,numel(jpegFiles));

for k = 1:length(jpegFiles)
    baseFileName = jpegFiles(k).name;
    fullFileName = fullfile(myFolder, baseFileName);
    fprintf(1, 'Now reading %s\n', fullFileName);
    imageArray64x64 = imread(fullFileName);
    imageArray64x64New = imresize(imageArray64x64, [64 64]);

       manosData{k} = imageArray64x64New;
end

%Save

But when i try to plot my 8 images, i just get a blank window. This is the code am using for that:

load manosData
for j=1:9
subplot(3,3,j)
end

Thanks, Cath.

Try instead:

load manosData
for j=1:9
subplot(3,3,j)
image(manosData{j})
end

the command subplot just creates a subaxis to the current figure. You need to apply a plotting command, for example image , plot , or line to draw any content to the axes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM