필터 지우기
필터 지우기

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 CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by