Calling a function without input arguments in Matlab gui

2 visualizzazioni (ultimi 30 giorni)
I am new to Matlab, I want to call a function in different GUI without sending any arguments( from one GUI to another GUI).
Example:
gui1.m (in GUIDE)
function some_ui_OpeningFun(hObject, eventdata, handles, varargin)
a = 10;
setappdata(0,'a',a);
gui2('pushbutton1_Callback'...) %<- to call the function in the second gui
handles.output = hObject;
guidata(hObject, handles);
gui2.m (in GUIDE)
function pushbutton1_Callback(hObject, eventdata, handles)
b = getappdata(0,'a');
disp(a);
so i want to call the function pushbutton1_Callback from gui2.m.
I have tried using gui2('pushbutton1_callback',handles,.....) which was give in the GUID comments. But could't get it.
Can anyone tell me how to do so?
thanks in advance.

Risposte (0)

Categorie

Scopri di più su Migrate GUIDE Apps in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by