File Exchange Pick of the Week

Our best user submissions

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:

The results looks like this:

Let us know what you think here or leave a comment for Steve.

|
  • print

コメント

コメントを残すには、ここ をクリックして MathWorks アカウントにサインインするか新しい MathWorks アカウントを作成します。