Borrar filtros
Borrar filtros

Making calculation in one and displaying results in other GUI

3 visualizaciones (últimos 30 días)
Banjo
Banjo el 6 de En. de 2018
Comentada: Rik el 7 de En. de 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 comentario
Rik
Rik el 7 de En. de 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?

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Interactive Control and Callbacks en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by