数模论坛

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

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

  [复制链接]
发表于 2012-11-16 17:47:02 | 显示全部楼层 |阅读模式
命令如下:
; ^2 A( D4 r" h) |& x0 a# [+ n/ Gscreen=get(0,'screensize');
+ _& |& j$ b  z( v( z* d, x2 z) fH=screen(4), W=screen(3);
& w8 ^- E0 B2 W- l" {- K2 A/ rfigure('color','[1,1,1]','position','[0.2*H, …0.2*H,0.5*W,0.2*W]','name',…  C% a$ J& x6 f! p; C" l% A' h
'图形演示系统','numbertitle','off',…5 r- e+ h. A" ], F  F6 O
'menubar','none');. {% b( w( w) T- o+ h7 v% R
hplot=uimenu(gcf,'label','&plot');  n% p- m" k& T
uimenu(hplot,'label','sine wave',…0 g) i. Z4 D0 @: z6 U0 }
'callback'['t=-pi:pi/20:2*pi;',…
& R0 s9 Y" N3 x" [1 H, L'plot(t,sin(t))','set(ghon,"enable","on")';…
+ T: D7 t- z, x'set(ghoff,"enable","on")';…3 V  z$ C) _& g$ A9 ?4 I
'set(ghon,"enable","on")';…
' _1 p, k5 v: t& l) S8 h3 m7 ~( r'set(ghoff,"enable","on")';]);
7 F. L6 \  k/ T- T- C) ]9 luimenu(hplot,'label','consign wave';…
$ q  ]: h. n, G, s'callback',['t=-pi:pi/20:2*pi;',…1 X' P. G4 u$ p  B$ y# `
'plot(t,cos(t))','set(ghon,"enable",…* l3 ^: C9 ^& x
"on")','set(ghoff,"enable","on"),…
- D" K1 e' B9 J5 o7 N'set(ghon,"enable",…3 y1 d2 P; D% U/ T+ `2 l7 {* W
"on")','set(ghoff,"enable","on")']);; S: O+ F2 j' a* V: |  z
hoption=uimenu(gcf,'label','&option');
4 D" N' O( P  ^hgon=uimenu(hoption,'label',…9 b/ u) r& q' o+ m7 h
'&grid on','call','grid on','enable','off');  O( Y+ I9 c' G7 k4 M: B# i! l5 j! C
hgoff=uimenu(hoption,'label',…
4 q3 Y' {3 \3 |+ g) p'&grid off','call','grid off','enable','off')
9 c  O1 |8 E8 A6 C- u* jhbon=uimenu(hoption,'label','&box on'…
/ N& Z- ?3 f! d,'separator','on','call','box on','enable',…" b1 O: j" Z2 k+ h" t
'off')' z8 ?5 m! e2 h% Z, J1 `. t6 Z  w
后面部分程序与上述有相似的效果,喜欢玩计算机的朋友可以转载哦…以后可能用着…谢谢看看
发表于 2013-4-27 11:47:47 | 显示全部楼层
啊哈哈,试试哦。有什么效果,就知道咯
您需要登录后才可以回帖 登录 | 注-册-帐-号

本版积分规则

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

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

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

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