saving images in loop
조회 수: 1 (최근 30일)
이전 댓글 표시
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
답변 (1개)
KSSV
2020년 5월 28일
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
참고 항목
카테고리
Help Center 및 File Exchange에서 Convert Image Type에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!