Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add progress bar control to Matlab gui?

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.

like image 357
shahar_m Avatar asked Mar 20 '11 13:03

shahar_m


People also ask

What is Waitbar Matlab?

f = waitbar( x , msg ) creates a nonmodal dialog box containing a wait bar with the specified message. The wait bar is fractional length x . The dialog box remains open until the code that controls it closes it or the user clicks the close button (X) in the dialog box title bar.

Where is GUI options in Matlab?

The GUI Options Dialog Box Access the dialog box from the GUIDE Layout Editor by selecting Tools > GUI Options. The options you select take effect the next time you save your UI.

How do I edit an existing GUI in Matlab?

Type guide in command window. A new GUI dialog box will appear. In the dialog box you will select the existing GUI project. To to the tab and you will find the gui file which you want to edit.


2 Answers

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.

like image 192
Yair Altman Avatar answered Sep 19 '22 12:09

Yair Altman


Yes, there is. The waitbar function is what you need. The examples there are easy to follow and you can get started right away. It should work fine on all 3 platforms (Windows/OS X/Linux).

like image 33
abcd Avatar answered Sep 18 '22 12:09

abcd