フィルターのクリア

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

2 ビュー (過去 30 日間)
Ram Kripal Singh
Ram Kripal Singh 2016 年 1 月 2 日
編集済み: Walter Roberson 2016 年 1 月 2 日
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);

回答 (0 件)

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by