How can I call Sub window from Main window on GUIDE?

2 ビュー (過去 30 日間)
MathWorks Support Team
MathWorks Support Team 2019 年 5 月 31 日
回答済み: MathWorks Support Team 2019 年 5 月 31 日
How can I call Sub window from Main window on GUIDE?

採用された回答

MathWorks Support Team
MathWorks Support Team 2019 年 5 月 31 日
On GUIDE, you may want to call a Sub window from the Main window, typically by pressing a pushbutton on the Main window.
1) Design main window and sub window. A pushbutton should be located on the main. main.m, main.fig, sub.m, sub.fig would be preserved.
2) Under the pushbutton Callback, which is "function pushbutton_Callback", call "sub".
3) If you wish to add input arguments into "sub", you can receive variables through "varargin" in Opening Function of sub, which is "function sub_OpeningFcn(hObject, eventdata, handles, varargin)".
main:
a = 123
b = 456
sub(a,b);
sub:
a = varargin{1} %123
b = varargin{2} %456

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeEntering Commands についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by