帮我看看这个GUI编程的问题
%main.m<BR>clf reset<BR>set(gcf,'unit','normalized','position',);<BR>set(gcf,'defaultuicontrolunits','normalized');<BR>set(gcf,'defaultuicontrolfontsize',11);<BR>set(gcf,'defaultucontrolhorizontal','left');<BR>set(gcf,'menubar','none');<BR>str='通过多行指令绘图的交互界面';<BR>set(gcf,'name',str,'numbertitle','off');<BR>h_axes=axes('position',,'visible','off');<BR>uicontrol(gcf,'Style','text','position',,'String','绘图指令框');<BR>hedit=uicontrol(gcf,'Style','edit','position',,'Max',2);<BR>hpop=uicontrol(gcf,'style','popup','position',,'string','spring|summer|autumn|winter');<BR>hlist=uicontrol(gcf,'style','list','position',,'sring','Grid on|Box on|Hidden off|Axis off','Max',2);<BR>hpush=uicontrol(gcf,'style','push','position',,'string','Apply');<BR>set(hedit,'callback','calledit(hedit,hpop,hlist)');<BR>set(hpop,'callback','calledit(hedit,hpop,hlist)');<BR>set(hpush,'callback','calledit(hedit,hpop,hlist)');<BR>%calledit.m<BR>function calledit(hedit,hpop,hlist)<BR>ct=get(hedit,'string');<BR>vpop=get(hpop,'value');<BR>vlist=get(hlist,'value');<BR>if ~ isempty(ct)<BR> eval(ct)<BR> popstr={'spring','summer','autumn','winter'};<BR> liststr={'grid on','box on','hidden off','axis off'};<BR> invstr={'grid off','box off','hidden on','axis on'};<BR> colormap=(eval(popstr{vpop}))<BR> vv=zeros(1,4);vv(vlist)=1<BR> for k=1:4<BR> if vv(k);eval(liststr{k});else eval(invstr{k});end<BR> end<BR>end<BR><BR>怎么老是出现?? Error: File: C:\MATLAB6p5\work\huitushuru.m Line: 20 Column: 1<BR>A function declaration cannot appear within a script M-file.<BR><BR>还有在问问。。如何能在菜单栏里弄上个动画的选项?<BR> Script文件里面不能定义函数,<BR>把%main.m改成function main就行<BR>原因是只有在*.m文件才能定义函数 那有没有实现图象动画的控件啊?。。<BR>就是输入个3D的绘图命令后,实现旋转之类的。。 不是很明白。<BR>如何能在菜单栏里弄上个动画的选项?<BR><BR>可以通过菜单调用一个子程序,子程序实现视角转变。<BR> <P>就是譬如我在上边的所编出来的一个GUI里输入一个绘图程序。<BR>然后在这个GUI里点击某建实现图象的旋转。。视角的转变。。<BR>你说的那个子程序要如何编写呢?</P>回复:(GRF-KYO)帮我看看这个GUI编程的问题
<P>用axes,视角之类的可以用view来实现</P>
页:
[1]