作者apple181818 (大苹果)
看板MATLAB
标题[问题] GUI介面转EXE之後找不到副程式
时间Wed Aug 15 17:34:25 2012
我的GUI介面~~有很多按钮按下去需要呼叫副程式执行~
在MATLAB里面可以执行~可是转成EXE之後~~他会说找不到副程式~
於是我另外写一个小档案~发现转成EXE之後还是找不到副程式~~
似乎是callback语法有错~但为什MATLAB里面可以执行?
主程式:(档名:tt1)
clear all;
h0 = figure('Visible','off','position',[100 100 800 600],...
'MenuBar','none','NumberTitle','off','name','test');
x=1:1:10;
y1=[2,3,5,8,5,5,6,8,9,10];
y2=[1,2,3,4,5,6,7,8,9,0];
plot(x,y2)
But1=('tt2(x,y1);'); %退出程式
but1con=uicontrol(gcf,'style','togglebutton',...
'fontsize',10,...
'string','<html>画出图案<br>  (Plot)<html>',...
'value',0,...
'position',[650 20 100 42],...
'callback',But1);
% Move the GUI to the center of the screen.
movegui(h0,'center')
% Make the GUI visible.
set(h0,'Visible','on');
副程式:(档名:tt2)
function fig= tt2(x,y1)
fig = figure(2);
plot(x,y1);
============================================================
我想请问一下~~有时候使用fig = figure(2);
他会开出另外第2个视窗来画图~为什有时候不行~~
要打怎样的指令可以令他开出第2视窗画图~而不是覆盖画上去??
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.115.70.74
※ 编辑: apple181818 来自: 140.115.70.74 (08/15 17:56)
1F:推 hebe0320:先window再plot呢? 12/19 12:31