progressbar
Will‘s pick this week is progressbar by Steve Hoelzer.
This is a File Exchange contribution that has been around since at least 2005. It has 76 downloads in the past 30 days and a 5 star rating from 122 votes. With a pedigree like this, I was shocked to find that the submission has never been a pick of the week. Jiro picked something similar in 2010. That one appears to have fallen out of usage, but Steve’s keeps on truckin.
Steve’s code hasn’t been altered in a decade, yet it continues to work in R2019b. It’s simple enough to use. You call progressbar to initialize the figure. A timer is kicked off behind the scenes. Inside your for loop, you call progressbar again, providing it a percentage of completion. This updates the figure and gives you an estimate of when the overall task will complete.
This works just fine if you have one task, but progressbar goes the extra mile and provides support for multiple tasks if you have nested loops. Here’s an example provided in the function:
Let us know what you think here or leave a comment for Steve.
- 범주:
- Utility
댓글
댓글을 남기려면 링크 를 클릭하여 MathWorks 계정에 로그인하거나 계정을 새로 만드십시오.