被忘却的纬度 发表于 2012-11-16 17:47:02

MATLAB中窗口控制程序

命令如下:
screen=get(0,'screensize');
H=screen(4), W=screen(3);
figure('color','','position','','name',…
'图形演示系统','numbertitle','off',…
'menubar','none');
hplot=uimenu(gcf,'label','&plot');
uimenu(hplot,'label','sine wave',…
'callback'['t=-pi:pi/20:2*pi;',…
'plot(t,sin(t))','set(ghon,"enable","on")';…
'set(ghoff,"enable","on")';…
'set(ghon,"enable","on")';…
'set(ghoff,"enable","on")';]);
uimenu(hplot,'label','consign wave';…
'callback',['t=-pi:pi/20:2*pi;',…
'plot(t,cos(t))','set(ghon,"enable",…
"on")','set(ghoff,"enable","on"),…
'set(ghon,"enable",…
"on")','set(ghoff,"enable","on")']);
hoption=uimenu(gcf,'label','&option');
hgon=uimenu(hoption,'label',…
'&grid on','call','grid on','enable','off');
hgoff=uimenu(hoption,'label',…
'&grid off','call','grid off','enable','off')
hbon=uimenu(hoption,'label','&box on'…
,'separator','on','call','box on','enable',…
'off')
后面部分程序与上述有相似的效果,喜欢玩计算机的朋友可以转载哦…以后可能用着…谢谢看看

wanganfu1 发表于 2013-4-27 11:47:47

啊哈哈,试试哦。有什么效果,就知道咯
页: [1]
查看完整版本: MATLAB中窗口控制程序