saving images in loop
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi,
frateMaps is a cell array. I would like to save images for each vector in frateMaps.
I could see the images for each loop but the images are not saved. I would like to save each image with labelling 1, 2, 3 etc based on loop number.
I tried to modify second parts of code but didn't work. could anyone please advise how to save? thank you.
for i = 1: length(fwdposx)
figure('color','w')
drawfield(frateMaps{i},'jet',max(max(frateMaps{i})));
titleStr = sprintf('%s%s%3.1f%s',tFileList{jj}(1:end-2),' Peak = ',max(max(frateMaps{i})),' Hz');
title(titleStr,'FontSize',20,'Interpreter','none');
axis off
axis image
drawnow;
ratemapImage= strcat(sessions{ii},[funcName,' Map Image ',date],'\',tFileList{jj}(1:end-2),'_forward rateMap_run');
imageStore(gcf,6,ratemapImage,150);%tif format, 150dpi
imageStore(gcf,3,ratemapImage,150);%eps format, 150dpi
close;
end
0 Kommentare
Antworten (1)
KSSV
am 28 Mai 2020
for i = 1: length(fwdposx)
figure('color','w')
drawfield(frateMaps{i},'jet',max(max(frateMaps{i})));
titleStr = sprintf('%s%s%3.1f%s',tFileList{jj}(1:end-2),' Peak = ',max(max(frateMaps{i})),' Hz');
title(titleStr,'FontSize',20,'Interpreter','none');
axis off
axis image
drawnow;
saveas(gcf,['image',num2str(i),'.png'])
ratemapImage= strcat(sessions{ii},[funcName,' Map Image ',date],'\',tFileList{jj}(1:end-2),'_forward rateMap_run');
imageStore(gcf,6,ratemapImage,150);%tif format, 150dpi
imageStore(gcf,3,ratemapImage,150);%eps format, 150dpi
close;
end
Siehe auch
Kategorien
Mehr zu Convert Image Type finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!