信息来自中文官网
waitbar
创建或更新等待条对话框
语法
f = waitbar(x,msg)
f = waitbar(x,msg,Name,Value)
waitbar(x)
waitbar(x,f)%更新数值
waitbar(x,f,msg)
参数
- f, 创建进度条返回的句柄
- x, 进度值,范围0-1
- msg, 显示信息
更多信息请查看中文官网原帖。
我的实例
f = waitbar(0,'Loading...','Name','数据读取...',...
'CreateCancelBtn','setappdata(gcbf,''canceling'',1)');
setappdata(f,'canceling',0);
formatSpec = 'The current excel is: %d/%d';
%提取excel列表数据并储存
for i = 1:lengthXlsx
%--------进度条------------
if getappdata(f,'canceling')
break
end
waitbar(i/lengthXlsx,f,sprintf(formatSpec,i,lengthXlsx));
%-------------------------
dataList{i,1} = readExcelData([pathExcel,'\',excelList{i}]);
end
delete(f);