Filter löschen
Filter löschen

Making calculation in one and displaying results in other GUI

3 Ansichten (letzte 30 Tage)
Banjo
Banjo am 6 Jan. 2018
Kommentiert: Rik am 7 Jan. 2018
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 Kommentar
Rik
Rik am 7 Jan. 2018
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?

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Interactive Control and Callbacks finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by