This link addresses to the way of saving variables in a workspace. Finally for each iteration of a parfor loop one .mat file will be generated. Is there any work around to save workspace in an appending way, so that each iteration's results gets added to the existing workspace?
I know one can write a separate code to merge all the workspace results into one file at the end, but I am mostly asking about doing that directly during parfor computations.
Here is the code that can be used for separately saving each iteration's workspace for instance:
parfor i=1:100
[pow_maxx,FFee,AA33,BB33,shape] = maintest(i);
filename=num2str(i);
m=matfile([filename,'.mat'],'writable',true);
m.i=i;
m.pow_maxx=pow_maxx;
m.FFee=FFee;
m.AA33=AA33;
m.BB33=BB33;
m.shape=shape;
end