所以,我创建了一个MATLAB脚本,需要几分钟才能执行.我决定在这里添加一个与文档相对应的等待栏:http://www.mathworks.se/help/matlab/ref/waitbar.html
我把它定义如下:
function crazyfunction4you();
h = waitbar(0,'Setting up...')
for i =1:N
waitbar(i/N,'Loading...')
%Some calculations is going on here
end
close(h);
end
Run Code Online (Sandbox Code Playgroud)
不知何故,这是打开一个数字的数字最终崩溃我的机器.我发现这种奇怪,因为我希望只出现一个数字:

我有兴趣听到你们有类似经历的天气吗?
您需要将句柄包含在等待栏中,否则Matlab会解释您要创建另一个句柄:
h = waitbar(0,'Setting up...')
for i =1:N
waitbar(i/N,h,'Loading...') %// Only this line changed. Added a handle
%// to refer to previously created waitbar
%Some calculations is going on here
end
close(h);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
705 次 |
| 最近记录: |