⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 progressbar.m.svn-base

📁 general toolbox......
💻 SVN-BASE
字号:
function progressbar(n,N,w)% progressbar - display a progress bar%%    progressbar(n,N,w);%% displays the progress of n out of N.% n should start at 1.% w is the width of the bar (default w=20).%%   Copyright (c) Gabriel Peyre 2006if nargin<3    w = 20;end% progress charcprog = '.';cprog1 = '*';% begining charcbeg = '[';% ending charcend = ']';p = min( floor(n/N*(w+1)), w);global pprev;if isempty(pprev)    pprev = -1;endif not(p==pprev)    ps = repmat(cprog, [1 w]);    ps(1:p) = cprog1;    ps = [cbeg ps cend];    if n>1        % clear previous string        fprintf( repmat('\b', [1 length(ps)]) );    end    fprintf(ps);endpprev = p;if n==N    fprintf('\n');end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -