Borrar filtros
Borrar filtros

How to update GUI with interims results of an algorithm in real time while the algorithm is still running??!

2 visualizaciones (últimos 30 días)
Hi mathworks community,
i have a quite simple question that i dont know how to deal with yet.
I implemented a GUI with GUIDE and run an Algorithm "heuristic.m" by pushing a PUSHBUTTON! This Algorithm produces better and better results as it converges to a better solution. I would like the user to always see the best so far solution produced by the algorithm on the GUI surface!
I tried doing so by putting the following lines in the algorithms code.
hMainGui = findobj('Tag','gui_surface') % find tag for GUI-Surface
handles=guidata(hMainGui) % Obtain handles for GUI-components
set(handles.solution_value,'string',solution_value_best_so_far) % Update of the GUI edit-textbox
Unfortunately i see that this code doesnt work while the algorithm is running!! But as soon as i stop the algorithm the corresponding values are written in the edit-textbox... Is there a possibility of getting a continous update during the runtime of the algorithm? What did i do wrong?
I am soo glad for your help!
Best regards, John

Respuesta aceptada

Walter Roberson
Walter Roberson el 1 de En. de 2016
After you set(), call drawnow()

Más respuestas (0)

Categorías

Más información sobre Environment and Settings en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by