How to add progress bar control to Matlab gui?

shahar_m picture shahar_m · Mar 20, 2011 · Viewed 31.4k times · Source

Is there a ready made progress bar uicontrol that can be added to Matlab gui, either uicontrol or ActiveX component?

[edit] I know about the waitbar function, I meant a component that can be implemented into the designed GUI and not just pop out of the window. Something like battery status in status bar.

Answer

Yair Altman picture Yair Altman · Mar 20, 2011

Waitbar and its variants display a popup window with a status bar. In most applications this is ok and very simple to use.

If you want to integrate a progress-bar within an existing GUI window, you have several choices:

  1. implement the internal waitbar code - this is really just an axes that presents a colored patch whose width depends on the progress value.
  2. use the standard java.swing.JProgressBar, which can be added to your Matlab GUI via the built-in javacomponent function
  3. use the StatusBar utility or the explanation here to add a progress bar to your GUI window's status-bar

All of these choices work on all Matlab platforms.