loopCount(i,n)
Displays progress information for “for” loops at the command window.
Takes inputs: i is current iteration and n is total number of iterations
NOTE: Call tic before loop and loopCount(i,n) before loop end
• Displays the current iteration out of the total to command window
• Also displays the time elapsed and time remaining.
• Times given in seconds, minutes or hours to aid clarity
• Gives update every 5 seconds
EXAMPLE:
>> n=3; w=6; tic;
>> for i=1:n
>> pause(w);
>> loopCount(i,n);
>> end
Outputs on the command line:
Completed iteration 1 of 3
. Time elapsed: 6 seconds. Time remaining: 12 seconds
Completed iteration 2 of 3
. Time elapsed: 12 seconds. Time remaining: 6 seconds
Completed all 3 iterations in 18 seconds
Cita come
Jody Muelaner (2025). loopCount(i,n) (https://it.mathworks.com/matlabcentral/fileexchange/67842-loopcount-i-n), MATLAB Central File Exchange. Recuperato .
Compatibilità della release di MATLAB
Compatibilità della piattaforma
Windows macOS LinuxCategorie
Tag
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Scopri Live Editor
Crea script con codice, output e testo formattato in un unico documento eseguibile.
| Versione | Pubblicato | Note della release | |
|---|---|---|---|
| 1.0.0.0 |
