IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
progress2_open.m
Go to the documentation of this file.
1 %> @ingroup globals usercomm
2 %> @file
3 %> @brief Creates progress bar.
4 %>
5 %> This version does not use globals
6 %
7 %> @param title='' Title
8 %> @param perc=0 Percent
9 %> @param i=[] Iteration number
10 %> @param n=[] Number of iterations
11 %> @return prgrss
12 function prgrss = progress2_open(title, perc, i, n)
13 
14 if nargin < 1 || isempty(title)
15  title = [];
16 end;
17 if nargin < 2 || isempty(perc)
18  perc = [];
19 end;
20 if nargin < 3 || isempty(i)
21  i = [];
22 end;
23 if nargin < 4 || isempty(n)
24  n = [];
25 end;
26 
27 prgrss.bars(1).title = title;
28 prgrss.bars(1).perc = perc;
29 prgrss.bars(1).i = i;
30 prgrss.bars(1).n = n;
31 prgrss.bars(1).tic = tic();
32 prgrss.bars(1).tic_lastcall = [];
33 prgrss.bars(1).sid = sprintf('P#%04d', floor(rand(1, 1)*9999));
34 
35 progress2_show(prgrss);
function progress2_open(in title, in perc, in i, in n)
function progress2_show(in prgrss)