数模论坛

 找回密码
 注-册-帐-号
搜索
热搜: 活动 交友 discuz
查看: 4883|回复: 1

[其他] MATLAB中窗口控制程序

  [复制链接]
发表于 2012-11-16 17:47:02 | 显示全部楼层 |阅读模式
命令如下:0 l; T) N8 U# ^% }
screen=get(0,'screensize');
+ y% d1 h- T$ Z1 {H=screen(4), W=screen(3);
- X! @* \' g% U) |. \" J8 s6 qfigure('color','[1,1,1]','position','[0.2*H, …0.2*H,0.5*W,0.2*W]','name',…# \+ [) P3 W! ^  S7 Y& y
'图形演示系统','numbertitle','off',…
* ]8 [$ E' X  j; S: q, }'menubar','none');- S* j% E) H6 Y- r3 J
hplot=uimenu(gcf,'label','&plot');
5 d/ k0 n  A, u; c8 Iuimenu(hplot,'label','sine wave',…
  I# Z4 O/ z. r: {3 i( J'callback'['t=-pi:pi/20:2*pi;',…
" d7 W2 g, _% j: ?4 `'plot(t,sin(t))','set(ghon,"enable","on")';…
0 w" L' f% L: x% s; j" [0 p'set(ghoff,"enable","on")';…' t) G! S6 o6 L* e
'set(ghon,"enable","on")';…5 _: _  |% ^- f
'set(ghoff,"enable","on")';]);
0 \4 c# _$ g$ B+ s% [& p( q+ N% v+ D( Duimenu(hplot,'label','consign wave';…. y; E/ w" a$ Y, L" Z5 X: H% P1 S
'callback',['t=-pi:pi/20:2*pi;',…8 _/ n+ a9 `& S. e1 V' P" f
'plot(t,cos(t))','set(ghon,"enable",…
* l) {8 E0 T7 {' d% a6 T7 w8 A"on")','set(ghoff,"enable","on"),…
# n! O* }4 W6 d* M'set(ghon,"enable",…: d( C0 a, m* L0 W# S3 U) Z( i7 ]: N
"on")','set(ghoff,"enable","on")']);
  ~4 k5 I9 `. l4 W& ^; rhoption=uimenu(gcf,'label','&option');; U' s0 g5 L2 T1 v; f- X
hgon=uimenu(hoption,'label',…3 R4 A0 |  D4 i& b# R2 Y
'&grid on','call','grid on','enable','off');
( E8 ]9 G  F: L  X$ F7 O3 Chgoff=uimenu(hoption,'label',…
) x. E7 C  x- u2 w: D- l# {) P0 D'&grid off','call','grid off','enable','off')
7 v, J: T" h) F9 P) m* X5 whbon=uimenu(hoption,'label','&box on'…' i. E6 S8 H# G
,'separator','on','call','box on','enable',…
# ~6 ~4 \  B2 K'off')
* M. A: r* j6 }& ^9 ]后面部分程序与上述有相似的效果,喜欢玩计算机的朋友可以转载哦…以后可能用着…谢谢看看
发表于 2013-4-27 11:47:47 | 显示全部楼层
啊哈哈,试试哦。有什么效果,就知道咯
您需要登录后才可以回帖 登录 | 注-册-帐-号

本版积分规则

小黑屋|手机版|Archiver|数学建模网 ( 湘ICP备11011602号 )

GMT+8, 2020-9-22 03:06 , Processed in 0.211867 second(s), 19 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表