当前位置 博文首页 > 早知晓的博客:【MATLAB】waitbar()函数设置进度条以及显示运行

    早知晓的博客:【MATLAB】waitbar()函数设置进度条以及显示运行

    作者:[db:作者] 时间:2021-07-30 08:50

    h=waitbar(0,'please wait');
    for i=1:1000
        waitbar(i/1000,h)
    end
    delete(h);
    

    注:

    (1)具体操作过程中一定是上述这种形式,即将h=waitbar(0,'please wait')写在循环外,“waitbar(i/1000,h)”写在循环内!!!若直接将h=waitbar(0,'please wait')写在循环内,则每次循环均会弹出新的waitbar图形框!

    (2)waitbar其他使用形式见MATLAB函数waitbar

    (3)tic - toc 联合使用查看计算时长!


    参考资料

    (1)matlab添加进度条(waitbar)

    (2)matlab 进度条/waitbar 显示运行进度

    (3)Matlab中tic和toc用法

    cs