What is the basic idea behind programming a progress/status bar in MATLAB?

I have a MATLAB GUI I am working on and I would like to make a progress or status bar to show the user how long a certain script will take to run or where it is running relative to when it will finish.

I am new to this GUI thing, anyone have any ideas on how this could be done?

I dont understand any of the examples (aka don;t know how to add to my code) on MATLAB's file exchange.




The simplest answer is just to call waitbar. It is already in matlab, and will pop up a figure with a status bar that grows as you progress.

Of course, you can also download one of the many tools on the FEX, all subtle variations on waitbar. Or, you can use a text based bar, that shows up in the command window. Sometimes a text bar is what even I will choose.

If you really insist on programming your own tool that shows up in a figure window, it is not difficult. I did one of these recently, where the bar also changed color with progress of my algorithm. One might easily use the changing color to signify one piece of information, and the length of the bar as a second piece of information. So for example, an optimization might have the bar get longer with every iteration, and change color from red to green as the objective itself grows smaller.

As I recall, I simply created a textbox in my window, with the string something like: 'I''m thinking, get some coffee while you wait.' I then made the box invisible until it was time to start processing. Now, at each iteration, change the size of the box, and or the color that fills it. When done, make the box invisible again.

GUI's consists of a visual part and the related code. Visual GUI components like 'Buttons' for example, are tied to a 'callback function', the code part. When you press a 'Button' an associated 'callback function' is executed. Programming a GUI in matlab means filling in your code in theses callback functions.

When your GUI Elements are well arranged with GUIDE, the visual editor, callback dummies for all used elements are generated. All you have to do is fill in your code, implementing the desired behavior.

When you worked through some basic GUI tutorials it might be a doable task to add a progress bar.


 ? Text progress bar in Matlab
 ? MATLAB update waitbar
 ? xlsread and waitbar MATLAB
 ? How to modify xlsread to get a step-by-step updated flag from loading process
 ? How can I make waitbar in MATLAB modal
 ? Get waitbar value in Matlab
 ? waitbar matlab before start a standalone script
 ? matlab progress bar not depanding on time
 ? JavaFX ProgressBar/ProgressIndicator: listen for change from multiple Sliders
 ? JavaFX ProgressBar/ProgressIndicator: listen for change from multiple Sliders