Skip to content

Commit e0be56b

Browse files
Update cmdWaitBar.html
1 parent 013a68f commit e0be56b

1 file changed

Lines changed: 54 additions & 38 deletions

File tree

pages/Fun things/cmdWaitBar.html

Lines changed: 54 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,34 @@
11
<div class="container">
2-
<h2 align="Left">cmdWaitBar</h2>
2+
<h2 align="center">cmdWaitBar</h2>
33

44
<h3><a href="https://github.com/HumanNeuronLab/cmdWaitBar/releases"><img src="https://img.shields.io/badge/v1.0.2-23%C2%B7Jan%C2%B72023-blue?logo=github" width="150" align="right"/></a><div align="left"><i>Matlab function that displays a progression bar in the command window.</i></div></h3>
55
</div>
6+
---
67

8+
This Matlab function will generate an updating progress bar (waitbar) in the command window.
79

8-
<p>This Matlab function will generate an updating progress bar (waitbar) in the command window. </p>
9-
<p>This is a useful tool during data processing over many iterations or time-cosuming computations. </p>
10-
<p>This simple visual feedback allows to track current progress and may also be a valuable tool for debugging and finding with value/entry may be causing an error.</p>
11-
<p>By using simple text output rather than a graphical interface, the computational sacrifice is minimised, which speeds tasks when compared to other waitbars that have graphical outputs.</p>
12-
<p>The waitbar will adapt to the current width of your command window.</p>
13-
<p><a href="https://ch.mathworks.com/matlabcentral/fileexchange/122357-cmdwaitbar"><img src="https://www.mathworks.com/matlabcentral/images/matlab-file-exchange.svg" alt="View cmdWaitBar on File Exchange"></a></p>
14-
<hr>
10+
This is a useful tool during data processing over many iterations or time-cosuming computations.
11+
12+
This simple visual feedback allows to track current progress and may also be a valuable tool for debugging and finding with value/entry may be causing an error.
13+
14+
By using simple text output rather than a graphical interface, the computational sacrifice is minimised, which speeds tasks when compared to other waitbars that have graphical outputs.
15+
16+
The waitbar will adapt to the current width of your command window.
17+
18+
[![View cmdWaitBar on File Exchange](https://www.mathworks.com/matlabcentral/images/matlab-file-exchange.svg)](https://ch.mathworks.com/matlabcentral/fileexchange/122357-cmdwaitbar)
19+
20+
---
21+
22+
<br>
23+
24+
There are 2 viewer modes:
25+
26+
- Waitbar (viewer mode 1 - default): Good for global progression tracking, fast simple, customisable.
27+
- Iteration (viewer mode 2): displays current iteration out of total for detailed view on current progress - good for debugging.
28+
29+
> NB: best use is to call the cmdWaitBar function at the start of the for-loop in order to get most accurate information for debugging!
1530
<br>
1631

17-
<p>There are 2 viewer modes:</p>
18-
<ul>
19-
<li>Waitbar (viewer mode 1 - default): Good for global progression tracking, fast simple, customisable.</li>
20-
<li>Iteration (viewer mode 2): displays current iteration out of total for detailed view on current progress - good for debugging.</li>
21-
</ul>
22-
<blockquote>
23-
<p>NB: best use is to call the cmdWaitBar function at the start of the for-loop in order to get most accurate information for debugging!
24-
<br></p>
25-
</blockquote>
2632
<table>
2733
<tr>
2834
<td> Viewer mode: </td> <td> Viewer 1 (default - waitbar) </td> <td> Viewer 2 (Current iteration) </td>
@@ -31,58 +37,65 @@ <h3><a href="https://github.com/HumanNeuronLab/cmdWaitBar/releases"><img src="ht
3137
<td> Example code </td>
3238
<td>
3339

34-
<pre><code class="language-matlab">iStart = 1;
40+
```matlab
41+
iStart = 1;
3542
iStop = 50000;
3643
for i = iStart:iStop
3744

38-
%(customise with e.g: &#39;-&#39;)
45+
%(customise with e.g: '-')
3946
cmdWaitBar(iStart,iStop,i)
4047

4148
%[Your code...]
4249
end
43-
</code></pre>
50+
```
51+
4452
</td>
4553
<td>
4654

47-
<pre><code class="language-matlab">iStart = 1;
55+
```matlab
56+
iStart = 1;
4857
iStop = 50000;
4958
for i = iStart:iStop
5059

5160
cmdWaitBar(iStart,iStop,i,2)
5261

5362
%[Your code...]
5463
end
55-
</code></pre>
64+
```
65+
5666
</td>
5767
</tr>
5868
<tr>
5969
<td> Command window output </td>
6070
<td>
6171

62-
<p><img src="https://github.com/jonathanmonney/misc_assets/blob/main/cmdWaitBar/viewer1.gif" alt="Alt Text"></p>
72+
![Alt Text](https://github.com/jonathanmonney/misc_assets/blob/main/cmdWaitBar/viewer1.gif)
73+
6374
</td>
6475
<td>
6576

66-
<p><img src="https://github.com/jonathanmonney/misc_assets/blob/main/cmdWaitBar/viewer2.gif" alt="Alt Text"></p>
77+
![Alt Text](https://github.com/jonathanmonney/misc_assets/blob/main/cmdWaitBar/viewer2.gif)
78+
6779
</td>
6880
</tr>
6981
</table>
7082
<br><br>
7183

72-
<h3 id="how-to-use">How to use:</h3>
73-
<p><strong>Within a &quot;for&quot; loop in matlab, insert a call to the function with the following three arguments</strong></p>
74-
<ul>
75-
<li>iStart, the integer the for-loop starts at</li>
76-
<li>iStop, the final iterative value</li>
77-
<li>i, the current iteration&#39;s value</li>
78-
</ul>
79-
<p><strong>Optional arguments that can be passed to the function:</strong></p>
80-
<ul>
81-
<li>&#39;(char-of-choice)&#39; for the waitbar. Default is &#39;·&#39;, such as [···]. Only the first char in a string will be used when passed to the function as an argument (e.g: &#39;-;&#39; will generate [---]).</li>
82-
<li>Viewer mode: value 1 or 2. 1 (default) generates the waitbar with a percentage value. 2 generates the current iteration value over iStop (e.g: &quot;Iteration: 72/223&quot;).
83-
<br><br></li>
84-
</ul>
85-
<hr>
84+
### How to use:
85+
86+
**Within a "for" loop in matlab, insert a call to the function with the following three arguments**
87+
- iStart, the integer the for-loop starts at
88+
- iStop, the final iterative value
89+
- i, the current iteration's value
90+
91+
**Optional arguments that can be passed to the function:**
92+
- '(char-of-choice)' for the waitbar. Default is '·', such as [···]. Only the first char in a string will be used when passed to the function as an argument (e.g: '-;' will generate [---]).
93+
- Viewer mode: value 1 or 2. 1 (default) generates the waitbar with a percentage value. 2 generates the current iteration value over iStop (e.g: "Iteration: 72/223").
94+
<br><br>
95+
96+
97+
---
98+
8699
<p align="center"> <b><u>cmdWaitBar</u></b> 2025
87100
| <a href="https://www.unige.ch/medecine/neucli/en/groupes-de-recherche/1034megevand/">Human Neuron Lab</a> - UNIGE
88101
| <a href="mailto:jonathan.monney@unige.ch">jonathan.monney@unige.ch</a></p>
@@ -91,5 +104,8 @@ <h3 id="how-to-use">How to use:</h3>
91104
<img src="https://raw.githubusercontent.com/HumanNeuronLab/ERWiN/main/assets/UNIGE_logo.png" width="200"/>
92105
</a></div>
93106

107+
---
108+
</div>
109+
94110
<hr>
95111
</div>

0 commit comments

Comments
 (0)