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.
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).
Adapting my code from this MatLab Newgroup comment, I was able to put together the following:
Creation is as follows, where
parent
is the parent panel that you want to add it to:and updating the progress bar is as simple as this:
Here's a full working example using a
figure
:another simple solution is to use two nested uipanels like this:
Usage:
Matlab has inbuilt 'waitbar'... you may also any of these tools from matlab site:
http://www.mathworks.com/matlabcentral/fileexchange/26773-progress-bar&watching=26773
http://www.mathworks.com/matlabcentral/fileexchange/3607-progressbar
For anyone still interested, here's my solution using a class:
Declare an instance like so:
pb = progressbar(gcf, [1 1], [0 20]);
It can be used with relative or actual numbers, i.e.
pb.pvalue = 10;
andpb.percent = .5;
do the same thing in my example.My version features a text object in the middle of the progress bar that displays the current percentage.
My latest version is available here.
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:
All of these choices work on all Matlab platforms.