Effacer les filtres
Effacer les filtres

Making calculation in one and displaying results in other GUI

3 vues (au cours des 30 derniers jours)
Banjo
Banjo le 6 Jan 2018
Commenté : Rik le 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 commentaire
Rik
Rik le 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?

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Interactive Control and Callbacks dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by