Calling a function without input arguments in Matlab gui

3 次查看(过去 30 天)
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.

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by