Azzera filtri
Azzera filtri

How to display running FOR loop iterations (counts) on GUI window automatically

2 visualizzazioni (ultimi 30 giorni)
Hell All,
I want to make a display button in my matlab GUI who can automatically show the running FOR loop iterations/ counts just like it shows in matlab workspace during programming running. e.g. 1,2,3...........200,....400....1000.....n-iterations
How to make such type of GUI DISPLAY window and what could be the script of this DISPLAY callback function?
Thank you very much in advance!
-- K.D.Singh

Risposta accettata

Dishant Arora
Dishant Arora il 11 Mar 2014
h = figure;
set(h , 'Units' , 'Normalized' , 'position' , [0.4 0.4 0.2 0.2]);
h1 = uicontrol(h , 'style' , 'text' , 'Units' , 'Normalized'...
, 'position' , [0.4 0.4 0.2 0.2] , 'string' , 'Output');
for ii = 1:10
set(h1 , 'string' , num2str(ii));
pause(0.5)
drawnow;
end
  7 Commenti
Image Analyst
Image Analyst il 12 Mar 2014
The key thing was the drawnow. Anytime your display doesn't update fast enough, insert a drawnow. Here's another link to help you learn MATLAB: http://www.mathworks.com/matlabcentral/answers/8026-best-way-s-to-master-matlab
And for image processing demos (though only a handful of over a hundred that I have), you can go here: http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Loops and Conditional Statements in Help Center e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by