信息來自中文官網(wǎng)
waitbar
創(chuàng)建或更新等待條對(duì)話框
語法
f = waitbar(x,msg)
f = waitbar(x,msg,Name,Value)
waitbar(x)
waitbar(x,f)%更新數(shù)值
waitbar(x,f,msg)
參數(shù)
- f, 創(chuàng)建進(jìn)度條返回的句柄
- x, 進(jìn)度值工育,范圍0-1
- msg, 顯示信息
更多信息請(qǐng)查看中文官網(wǎng)原帖。
我的實(shí)例
f = waitbar(0,'Loading...','Name','數(shù)據(jù)讀取...',...
'CreateCancelBtn','setappdata(gcbf,''canceling'',1)');
setappdata(f,'canceling',0);
formatSpec = 'The current excel is: %d/%d';
%提取excel列表數(shù)據(jù)并儲(chǔ)存
for i = 1:lengthXlsx
%--------進(jìn)度條------------
if getappdata(f,'canceling')
break
end
waitbar(i/lengthXlsx,f,sprintf(formatSpec,i,lengthXlsx));
%-------------------------
dataList{i,1} = readExcelData([pathExcel,'\',excelList{i}]);
end
delete(f);