Borrar filtros
Borrar filtros

How can I update Text box dynamically(in regular intervals) in Matlab GUI?

2 visualizaciones (últimos 30 días)
Below is the callback function for the pushbutton run in the GUI: I want to run a while loop which continuously updates the value in the edit text box of the GUI with value from the simulink model but as soon as I press the RUN button in the GUI, it goes into infinite while loop and the simulation does not run.
function pushbutton_run_Callback(hObject, eventdata, handles)
handles=guidata(hObject);
flag=get(hObject,'string');
if strcmp(flag,'RUN')==1
set_param(handles.modelname,'SimulationCommand','Start');
set(hObject,'string','STOP');
while(strcmp(get(handles.pushbutton_run,'string'),'STOP'))
%some code for updating text box
end
else
set_param(handles.modelname,'SimulationCommand','Stop');
set(hObject,'string','RUN');
end
guidata(hObject,handles);

Respuestas (0)

Categorías

Más información sobre Migrate GUIDE Apps 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