Effacer les filtres
Effacer les filtres

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

2 vues (au cours des 30 derniers jours)
Ram Kripal Singh
Ram Kripal Singh le 2 Jan 2016
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);

Réponses (0)

Catégories

En savoir plus sur Migrate GUIDE Apps dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by