数模论坛

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

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

  [复制链接]
发表于 2012-11-16 17:47:02 | 显示全部楼层 |阅读模式
命令如下:
) w$ u' l3 S, V: Uscreen=get(0,'screensize');* Y' ^5 F% Z$ d/ W( _
H=screen(4), W=screen(3);
" U2 I" n' z! {8 f3 xfigure('color','[1,1,1]','position','[0.2*H, …0.2*H,0.5*W,0.2*W]','name',…5 s, }) ~3 }) u8 h3 [0 c# T( `
'图形演示系统','numbertitle','off',…1 h- e& }# ]! ~7 I* c- q
'menubar','none');1 ^7 S2 O, q- I; M& L. F! E, O
hplot=uimenu(gcf,'label','&plot');) B* W! ~) k$ b( P- c
uimenu(hplot,'label','sine wave',…
+ i$ k( t' z' ^+ N9 U3 g" a'callback'['t=-pi:pi/20:2*pi;',…$ r* |1 Q8 K( J8 T7 E, u
'plot(t,sin(t))','set(ghon,"enable","on")';…
1 |; C8 V; g6 X6 g6 i# S+ x: Q'set(ghoff,"enable","on")';…, s4 z4 a+ u+ M* x
'set(ghon,"enable","on")';…
8 j/ j0 m0 a) y'set(ghoff,"enable","on")';]);  D6 S  k$ R1 ?8 b
uimenu(hplot,'label','consign wave';…5 L4 r' a2 y+ [9 E
'callback',['t=-pi:pi/20:2*pi;',…
) `4 B9 V5 O$ D$ [  W'plot(t,cos(t))','set(ghon,"enable",…
. a% ~( R8 n; ^* X"on")','set(ghoff,"enable","on"),…$ h( \5 V/ I. |% s- Q
'set(ghon,"enable",…
, X; J& G. B2 e0 S"on")','set(ghoff,"enable","on")']);
9 j2 G$ |; L6 @( khoption=uimenu(gcf,'label','&option');
  f, g; F9 U2 N# Q  ~) Nhgon=uimenu(hoption,'label',…
5 V) D( O$ K+ C'&grid on','call','grid on','enable','off');' M6 ?) l$ S+ ^
hgoff=uimenu(hoption,'label',…
, }8 x; ~+ ]6 u; |'&grid off','call','grid off','enable','off')0 G3 ^( d; }: a0 t( N0 b
hbon=uimenu(hoption,'label','&box on'…
7 u2 O) I$ r; A$ t7 y% r0 U" E,'separator','on','call','box on','enable',…8 X2 n9 E; G0 b2 e1 q2 n) A
'off')
- ~7 ]0 D9 t0 D, B后面部分程序与上述有相似的效果,喜欢玩计算机的朋友可以转载哦…以后可能用着…谢谢看看
发表于 2013-4-27 11:47:47 | 显示全部楼层
啊哈哈,试试哦。有什么效果,就知道咯
您需要登录后才可以回帖 登录 | 注-册-帐-号

本版积分规则

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

GMT+8, 2024-11-30 06:37 , Processed in 0.056958 second(s), 19 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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