0001 function myoutput=pm3_core(myinputs,fpar,nvar,whoiam, ThisMatlab)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036 if nargin<4,
0037 whoiam=0;
0038 end
0039
0040
0041
0042
0043 tit1=myinputs.tit1;
0044 nn=myinputs.nn;
0045 n2=myinputs.n2;
0046 Distrib=myinputs.Distrib;
0047 varlist=myinputs.varlist;
0048 MaxNumberOfPlotsPerFigure=myinputs.MaxNumberOfPlotsPerFigure;
0049 name3=myinputs.name3;
0050 tit3=myinputs.tit3;
0051 Mean=myinputs.Mean;
0052
0053 if whoiam
0054 Parallel=myinputs.Parallel;
0055 end
0056
0057
0058 global options_ M_ oo_
0059
0060
0061 if whoiam
0062 prct0={0,whoiam,Parallel(ThisMatlab)};
0063 h = dyn_waitbar(prct0,'Parallel plots pm3 ...');
0064 end
0065
0066
0067
0068 figunumber = 0;
0069 subplotnum = 0;
0070 hh = dyn_figure(options_,'Name',[tit1 ' ' int2str(figunumber+1)]);
0071 RemoteFlag = 0;
0072 if whoiam,
0073 if Parallel(ThisMatlab).Local ==0
0074 RemoteFlag=1;
0075 end
0076 end
0077
0078 OutputFileName = {};
0079
0080 for i=fpar:nvar
0081 if max(abs(Mean(:,i))) > 10^(-6)
0082 subplotnum = subplotnum+1;
0083 set(0,'CurrentFigure',hh);
0084 subplot(nn,nn,subplotnum);
0085 plot([1 n2],[0 0],'-r','linewidth',0.5);
0086 hold on
0087 for k = 1:9
0088 plot(1:n2,squeeze(Distrib(k,:,i)),'-g','linewidth',0.5);
0089 end
0090 plot(1:n2,Mean(:,i),'-k','linewidth',1);
0091 xlim([1 n2]);
0092 hold off;
0093 name = deblank(varlist(i,:));
0094 title(name,'Interpreter','none')
0095 end
0096
0097 if whoiam,
0098 if Parallel(ThisMatlab).Local==0
0099 DirectoryName = CheckPath('Output',M_.dname);
0100 end
0101 end
0102
0103 if subplotnum == MaxNumberOfPlotsPerFigure || i == nvar
0104 dyn_saveas(hh,[M_.dname '/Output/' M_.fname '_' name3 '_' deblank(tit3(i,:))],options_);
0105 if RemoteFlag==1,
0106 OutputFileName = [OutputFileName; {[M_.dname, filesep, 'Output',filesep], [M_.fname '_' name3 '_' deblank(tit3(i,:)) '.*']}];
0107 end
0108 subplotnum = 0;
0109 figunumber = figunumber+1;
0110 if (i ~= nvar)
0111 hh = dyn_figure(options_,'Name',[name3 ' ' int2str(figunumber+1)]);
0112 end
0113 end
0114
0115 if whoiam,
0116
0117
0118 dyn_waitbar((i-fpar+1)/(nvar-fpar+1),h);
0119 end
0120
0121
0122 end
0123
0124 if whoiam,
0125 dyn_waitbar_close(h);
0126 end
0127 myoutput.OutputFileName=OutputFileName;