24小时热门版块排行榜    

CyRhmU.jpeg
查看: 235  |  回复: 1
当前主题已经存档。

z86197322

银虫 (小有名气)

[交流] 【求助】matlab的GUI设计中,如何在一个窗口中调用另一个窗口?

说得简单点,有两个界面,figure1和figure2,在figure1中调用callback函数,可以打开figure2。
回复此楼
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

xiegangmai

版主 (职业作家)

我没头衔

优秀版主优秀版主优秀版主

★ ★ ★
z86197322(金币+1):谢谢参与
z86197322(金币+2): 1-26 11:19
z86197322(金币+2): 2010-03-22 16:36
两个fig文件相互调用:

function fig1


h1_fig1=figure('name',' fig1',...
    'numbertitle','off',...
    'defaultuicontrolfontsize',6,...
    'defaultuicontrolunits','normalized');   

h1_button_call=uicontrol( 'parent',h1_fig1,...
'style','push',...
'position',[0.80 0.29 0.15 0.05],...
'string','显示fig2',...
'fontsize',12,...
'backgroundcolor','w',...
'callback','fig2');% 设置回调函数为caculate1

h1_button_close=uicontrol(...
'parent',h1_fig1,...
'style','push',...
'position',[0.80 0.02 0.15 0.05],...
'string','退出',...
'fontsize',12,...
'backgroundcolor','w',...
'callback','close');




function fig2


h2_fig2=figure('name',' fig2',...
    'numbertitle','off',...
    'defaultuicontrolfontsize',6,...
    'defaultuicontrolunits','normalized');   

h2_button_call=uicontrol('parent',h2_fig2,...
'style','push',...
'position',[0.80 0.29 0.15 0.05],...
'string','显示fig1',...
'fontsize',12,...
'backgroundcolor','w',...
'callback','fig1');% 设置回调函数为caculate1

h2_button_close=uicontrol(...
'parent',h2_fig2,...
'style','push',...
'position',[0.80 0.02 0.15 0.05],...
'string','退出',...
'fontsize',12,...
'backgroundcolor','w',...
'callback','close');
明德厚学、求是创新
2楼2010-01-26 09:48:32
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 z86197322 的主题更新
普通表情 高级回复(可上传附件)
信息提示
请填处理意见