progressbar.m
来自「matlab处理图像的一些基本方法。其中有一部分mex程序需要安装编译」· M 代码 · 共 59 行
M
59 行
function progressbar(x,tit)%PROGRESSBAR Display wait bar in the statusbar.%% PROGRESSBAR('title', X)%% displays a progress bar of fractional length X in the statusbar.% X should be between 0 and 1. % Each subsequent call to progressbar, PROGRESSBAR(X), extends the % length of the bar to the new position X.% When x=1 the statusbar will be cleaned.%% for i=1:100,% % computation here %% progressbar('Working on ', i/100);% end%% Claudio Rivetti 10-21-94%%% Copyright (c) 1995 by Claudio Rivetti and Mark Young% claudio@alice.uoregon.edu, mark@alice.uoregon.edu%if nargin==1 tit=[];endBarlen=95-length(tit);str=zeros(1,Barlen);x=ceil(x*Barlen);str(1:x)=str(1:x)+'o';str(x+1:Barlen)=str(x+1:Barlen)+'.';str=[tit ' [' str ']'];if ~isempty(str) statusbar(setstr(str*find(x~=Barlen)));endreturn
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?