|
Hi, friends:
For some reaons I always get from with this function, xlswrite. I used this fuction in a loop. It will work well for a lot of iterations but sundenly get error information in some iteration. The error information is
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
??? Error using ==> xlswrite at 253
The file N:\Personal\MATLAB\Disastercode\matlab\outputS3.xls is not writable. It
may be locked by another process.
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
I really do not know what happen, could some one help me? (Thanks a lot)
The codes are simplied prestented below:
For s=1: Sn
yxlsname=strcat('yS',int2str(s),'.xls');
y_avgxlsname=strcat('y_avgS',int2str(s),'.xls');
wfxlsname=strcat('wfS',int2str(s),'.xls');
outputxlsname=strcat('outputS',int2str(s),'.xls');
ymesname=strcat('ymsgS',int2str(s),'.xls');
delete(yxlsname);
delete(wfxlsname);
delete(outputxlsname);
delete(ymesname);
for wf_n =1: FN
sheetnamey=strcat('Y_','s',int2str(s),'_Wfn',int2str(wf_n))
xlswrite (yxlsname, Y{s,wf_n}, sheetnamey);
xlswrite (yxlsname, uniqueY, strcat('uniqueY', '_Wfn',int2str(wf_n)));
sheetnameyavg=strcat('Y_avg_','s',int2str(s),'_Wfn',int2str(wf_n))
xlswrite (y_avgxlsname, Y_avg{s,wf_n}, sheetnameyavg);
xlswrite (y_avgxlsname, uniqueY_avg, strcat('uniqueYavg','_Wfn',int2str(wf_n)));
sheetnamewf=strcat('Wf_','s',int2str(s),'_Wfn',int2str(wf_n))
xlswrite (wfxlsname, Wf{s,wf_n}, sheetnamewf);
end
xlswrite(outputxlsname, {'s','wf_s','wf_stepsize','wf_e' ;s, wf_s, wf_stepsize, wf_e}, 'readme');
xlswrite(outputxlsname, best_lv2, 'lv2best' );
xlswrite(outputxlsname, lb, 'lb');
xlswrite(outputxlsname, tlevel2, 'tlevel2');
end
|