数模论坛

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

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

  [复制链接]
发表于 2012-11-16 17:47:02 | 显示全部楼层 |阅读模式
命令如下:
, V, Y' o, M9 @screen=get(0,'screensize');
+ @5 Y+ g5 @  V; N0 O1 PH=screen(4), W=screen(3);" k5 p' V" v, x7 D$ O( h
figure('color','[1,1,1]','position','[0.2*H, …0.2*H,0.5*W,0.2*W]','name',…3 i  h8 w% a& p% g
'图形演示系统','numbertitle','off',…. k7 k2 |+ @3 Z* t: O& u8 j! i; {, i
'menubar','none');
1 L3 c! u# k) B- H. d  {hplot=uimenu(gcf,'label','&plot');7 K& X" C5 C# v0 s- V
uimenu(hplot,'label','sine wave',…
$ J) U8 I. U# F& E5 o/ W0 h, j'callback'['t=-pi:pi/20:2*pi;',…
9 L' _( g+ ]! N- Y, T" i'plot(t,sin(t))','set(ghon,"enable","on")';…
/ ]$ {1 S; S) M' @* @'set(ghoff,"enable","on")';…/ J8 ?7 _7 j- h$ ^+ I# p1 q0 F0 F
'set(ghon,"enable","on")';…( e* Q* k% E1 d* `/ [6 |& u2 W
'set(ghoff,"enable","on")';]);' [  x+ V2 h, p: k! Z
uimenu(hplot,'label','consign wave';…6 P" T/ K) _$ R+ U. }7 m1 A
'callback',['t=-pi:pi/20:2*pi;',…$ H* p* j( m; ^1 u7 a: l- u! ]
'plot(t,cos(t))','set(ghon,"enable",…8 y6 [! \2 {7 k, o5 S6 L/ I6 h
"on")','set(ghoff,"enable","on"),…
1 A" N1 Q& {1 N+ \6 D1 t$ x'set(ghon,"enable",…( e, d( b' \/ Y% V& Y. ]. C$ Y
"on")','set(ghoff,"enable","on")']);
: B3 H0 `0 W+ s( W# c# v4 Dhoption=uimenu(gcf,'label','&option');
* s- c- I! s! chgon=uimenu(hoption,'label',…
! l. P$ j. D0 p'&grid on','call','grid on','enable','off');
- K* j3 n! j; H1 I4 b6 Khgoff=uimenu(hoption,'label',…. n4 N& M; s9 m" l# \5 J5 n
'&grid off','call','grid off','enable','off')
0 T+ ]" }5 k7 w" dhbon=uimenu(hoption,'label','&box on'…8 v) o5 Q, G/ a7 O# L3 n, H' v1 z
,'separator','on','call','box on','enable',…# Y' R+ P) S4 Z4 b4 T1 F
'off')
  T) a/ {0 ^/ W8 I1 I" P后面部分程序与上述有相似的效果,喜欢玩计算机的朋友可以转载哦…以后可能用着…谢谢看看
发表于 2013-4-27 11:47:47 | 显示全部楼层
啊哈哈,试试哦。有什么效果,就知道咯
您需要登录后才可以回帖 登录 | 注-册-帐-号

本版积分规则

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

GMT+8, 2020-1-30 03:13 , Processed in 0.082897 second(s), 19 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

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