Hi,
I want to save 12 graphs created in other functions with using the "parfor" command. For this I collect all the handles in a single function named "SaveGraphs". Since the command "print" takes a long of time, I decided to apply the "parfor". My code looks as following
function SaveGraphs(f1,f2,...,f12) graphs=[f1;f2;...f12]; filePath={'path1';'path2;...'path12'}; SizeVec= matrix 12 X 2 with appropriated sizes for k=1:length(graphs) set(figure(graphs(k)),'PaperUnits','inches','PaperPosition',[0 0 SizeVec(k,:)]) print(graphs(k),'-dpng','-r1',filePath{k}) end parfor k=1:length(graphs) print(figure(graphs(k)),'-dpng','-r1',filePath{k}) end
The graphs are saved but they are empty. Any hint at a solution?
If I change the "parfor" to "for", it works.
Thanks in advance for helping
Best Answer