0001
0002
0003 function waitleftconsole(i,i0,istep,imax,init_sim,init_loop)
0004
0005
0006 estimate_simu = sec2hms(length([i:istep:imax])*etime(clock,init_sim)/length([i0:istep:i]));
0007 estimate_loop = sec2hms(length([i:istep:imax])*etime(clock,init_loop));
0008
0009
0010
0011
0012
0013 estimate_simu_str = hms2str(estimate_simu);
0014 estimate_loop_str = hms2str(estimate_simu);
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025 n = 56;
0026
0027
0028 star=['-' '\' '|' '/'];
0029
0030 idx=fix(n*length([i0:istep:i])/length([i0:istep:imax]));
0031 if (idx <= n)
0032 if (idx < n )
0033 output = ['|';' ';'[';repmat('*',idx,1);repmat(' ',(n-idx),1);...
0034 ']';' ';estimate_simu_str';' ';estimate_loop_str';' ';'|']';
0035 fprintf(output);
0036 elseif (idx ==n)
0037 output = ['|';' ';'[';repmat('*',n,1);']'; ...
0038 ' ';estimate_simu_str';' ';estimate_loop_str';' ';'|']';
0039 fprintf(output);
0040 end
0041 fprintf([repmat('\b',1,80)]);
0042 end
0043
0044 if (i == imax)
0045 fprintf('\n');
0046 end