필터 지우기
필터 지우기

Making calculation in one and displaying results in other GUI

조회 수: 3 (최근 30일)
Banjo
Banjo 2018년 1월 6일
댓글: Rik 2018년 1월 7일
Hello,
I have two GUIs, one for input data and other one for results. What I want is that when I insert all data in edit boxes of first GUI and when I click 'Calculate', second GUI to be opened with all results from calculation that was performed in the first GUI. I tried something with setappdata and getappdata but couldn't make it work. Example:
GUI1
function pushbutton1_Callback(hObject, eventdata, handles)
run gui2
a=str2double(get(handles.edit1,'string'));
b=str2double(get(handles.edit2,'string'));
c=multiply(a,b)
setappdata(0,'x',c);
GUI2
function edit1_Callback(hObject, eventdata, handles)
a=getappdata(0,'x');
set(handles.edit1,'string',a)
  댓글 수: 1
Rik
Rik 2018년 1월 7일
Isn't it possible for your case to use guidata on one of the two figures by just passing a handle to the figure of GUI 1 as an input argument for the function starting GUI 2?

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by