数模论坛

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

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

  [复制链接]
发表于 2012-11-16 17:47:02 | 显示全部楼层 |阅读模式
命令如下:) B9 k8 k& a3 E3 }$ w. [
screen=get(0,'screensize');& o0 c" _7 [' W# J& o/ }$ P2 {
H=screen(4), W=screen(3);
: a/ p3 \8 R4 S( Q$ c% {3 \figure('color','[1,1,1]','position','[0.2*H, …0.2*H,0.5*W,0.2*W]','name',…* F' P: r6 @3 o
'图形演示系统','numbertitle','off',…  s9 F# {3 ?& }! S/ r: I
'menubar','none');: i9 x2 }: h8 n5 y
hplot=uimenu(gcf,'label','&plot');
( Y# j. Q' x6 x9 X8 F9 z. muimenu(hplot,'label','sine wave',…
  O8 |* d+ O  m" O: \0 G'callback'['t=-pi:pi/20:2*pi;',…
5 `( J; ^* a4 z: x) j# p2 G'plot(t,sin(t))','set(ghon,"enable","on")';…
  ^6 t6 D+ ]! I'set(ghoff,"enable","on")';…
$ Q' X' R( g/ J'set(ghon,"enable","on")';…1 X3 t/ s: a4 o% R# A& n
'set(ghoff,"enable","on")';]);9 {+ _8 E+ P; T% a4 a# A
uimenu(hplot,'label','consign wave';…
' s$ f, V* V6 v4 u( l'callback',['t=-pi:pi/20:2*pi;',…8 e& A0 S: B! g% O
'plot(t,cos(t))','set(ghon,"enable",…
0 j5 K1 N6 e; k  q. Z"on")','set(ghoff,"enable","on"),…! v/ t& D9 p4 {( w
'set(ghon,"enable",…6 Q8 W2 C# a6 T* i# z/ ^+ y
"on")','set(ghoff,"enable","on")']);2 j9 l7 Z: z/ p2 I9 A" u
hoption=uimenu(gcf,'label','&option');
2 f, Q" [4 V) e4 Ihgon=uimenu(hoption,'label',…: q6 |' m" K) |" r+ x- u
'&grid on','call','grid on','enable','off');
, e7 z1 ^2 m! v9 B) xhgoff=uimenu(hoption,'label',…
- N# \7 Y- G+ s2 v# b'&grid off','call','grid off','enable','off')" z$ e3 T1 q, {- b
hbon=uimenu(hoption,'label','&box on'…( B+ K. _7 X: _1 y: K
,'separator','on','call','box on','enable',…
5 a, f! P1 C) w' h, \) D'off')
) t" R1 j5 q4 \! ^: s- H$ T8 b) q后面部分程序与上述有相似的效果,喜欢玩计算机的朋友可以转载哦…以后可能用着…谢谢看看
发表于 2013-4-27 11:47:47 | 显示全部楼层
啊哈哈,试试哦。有什么效果,就知道咯
您需要登录后才可以回帖 登录 | 注-册-帐-号

本版积分规则

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

GMT+8, 2025-8-30 08:05 , Processed in 0.052711 second(s), 19 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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