saving images in loop
    6 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
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 comentarios
Respuestas (1)
  KSSV
      
      
 el 28 de Mayo de 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
Ver también
Categorías
				Más información sobre Printing and Saving en Help Center y File Exchange.
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!