saving images in loop
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (1)
KSSV
le 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
Voir également
Catégories
En savoir plus sur Printing and Saving dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!