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')
后面部分程序与上述有相似的效果,喜欢玩计算机的朋友可以转载哦…以后可能用着…谢谢看看 啊哈哈,试试哦。有什么效果,就知道咯
页:
[1]