数模论坛

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

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

  [复制链接]
发表于 2012-11-16 17:47:02 | 显示全部楼层 |阅读模式
命令如下:7 B6 k; D1 i9 r- A) o: N& M
screen=get(0,'screensize');
# p9 Y/ `8 L9 v  }5 cH=screen(4), W=screen(3);
* i/ X& ~/ k) @& lfigure('color','[1,1,1]','position','[0.2*H, …0.2*H,0.5*W,0.2*W]','name',…
8 c  j# B* i; _! Y) w" Z* E* U'图形演示系统','numbertitle','off',…! E" W, [8 V6 p4 H- d# Z2 Z
'menubar','none');
+ q5 Q! ]/ [; e8 [& C, N5 |hplot=uimenu(gcf,'label','&plot');
9 t; ]7 k; O# P8 G; G. Uuimenu(hplot,'label','sine wave',…6 I4 q4 \( e7 |; }
'callback'['t=-pi:pi/20:2*pi;',…8 r& [) D4 [; [/ ?# ?6 n
'plot(t,sin(t))','set(ghon,"enable","on")';…
5 h/ n# K3 A& @* |' K: e'set(ghoff,"enable","on")';…
  V3 f  U/ z8 E, e9 Z6 Q0 m'set(ghon,"enable","on")';…6 {4 a+ K4 G  V& |7 h' s+ u
'set(ghoff,"enable","on")';]);* U9 G: g. {, \. s" |8 S
uimenu(hplot,'label','consign wave';…
' }, ~* Q0 C( V0 T8 t$ v'callback',['t=-pi:pi/20:2*pi;',…
1 U  _; l6 c  F: s$ b* ?& B'plot(t,cos(t))','set(ghon,"enable",…& X) L3 I* f$ s8 d/ M
"on")','set(ghoff,"enable","on"),…
- T' c8 B: y3 ['set(ghon,"enable",…
+ W* @: H! M* B% J+ L"on")','set(ghoff,"enable","on")']);
4 w- F& v3 Z: `" ^hoption=uimenu(gcf,'label','&option');0 \( V0 }" ~; M% h- o
hgon=uimenu(hoption,'label',…
8 s! F  h+ `& K& T$ ~4 ^'&grid on','call','grid on','enable','off');/ H8 q8 l7 @( b: J: ~
hgoff=uimenu(hoption,'label',…
3 ]$ A; w$ X3 e% T; v4 X'&grid off','call','grid off','enable','off')
& n- `# N/ B) u2 O4 M8 p! I6 ghbon=uimenu(hoption,'label','&box on'…5 {3 d1 T* W/ O( _! `3 u% u. g4 D# n
,'separator','on','call','box on','enable',…
) j( t0 Z. p3 y0 F'off')1 [9 t/ U% _* r( m# ?" D$ M- c. |
后面部分程序与上述有相似的效果,喜欢玩计算机的朋友可以转载哦…以后可能用着…谢谢看看
发表于 2013-4-27 11:47:47 | 显示全部楼层
啊哈哈,试试哦。有什么效果,就知道咯
您需要登录后才可以回帖 登录 | 注-册-帐-号

本版积分规则

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

GMT+8, 2026-4-15 10:27 , Processed in 0.067585 second(s), 19 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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