Borrar filtros
Borrar filtros

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

2 visualizaciones (últimos 30 días)
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

Respuesta aceptada

Dishant Arora
Dishant Arora el 11 de Mzo. de 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 comentarios
Image Analyst
Image Analyst el 12 de Mzo. de 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
Keshav Dev Singh
Keshav Dev Singh el 18 de Mzo. de 2014
Thanks Dishant, your help will be greatly appreciated.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by