数模论坛

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

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

  [复制链接]
发表于 2012-11-16 17:47:02 | 显示全部楼层 |阅读模式
命令如下:% R3 Y5 C( j, D+ f- `
screen=get(0,'screensize');
8 z8 m* k4 F4 G* `% J0 v# K) @! UH=screen(4), W=screen(3);5 o6 c/ H' M8 C. U8 ~0 }  x
figure('color','[1,1,1]','position','[0.2*H, …0.2*H,0.5*W,0.2*W]','name',…- e3 E9 `* F6 z1 B6 K
'图形演示系统','numbertitle','off',…
5 g! R; [4 s! _2 x* ^'menubar','none');  O) u- o0 P1 f8 d$ q( v
hplot=uimenu(gcf,'label','&plot');
' ~, C# m/ F) h: buimenu(hplot,'label','sine wave',…- P% i% e% `8 m. H, o4 q' x7 T8 x
'callback'['t=-pi:pi/20:2*pi;',…
) I) ^6 V* e' v- B( b/ m'plot(t,sin(t))','set(ghon,"enable","on")';…
5 T+ l! a& i' X9 b'set(ghoff,"enable","on")';…. T' t- w. K! p# o* t5 K. ^
'set(ghon,"enable","on")';…
( C- N6 p9 x( j'set(ghoff,"enable","on")';]);
1 s" e5 ~1 m7 e5 O4 x; k, W* W" f: l: Auimenu(hplot,'label','consign wave';…
! Z' @7 ?1 g$ w'callback',['t=-pi:pi/20:2*pi;',…5 Y8 ?: e* p1 l2 r/ \8 E" l
'plot(t,cos(t))','set(ghon,"enable",…
) j* Y  a5 J( x' T2 t5 p4 N: ~: n$ o"on")','set(ghoff,"enable","on"),…$ O! z, t2 F; Y  V! S
'set(ghon,"enable",…+ E* y+ M# i# v
"on")','set(ghoff,"enable","on")']);
4 @% }! i; E' _$ L: G1 R$ Y4 ihoption=uimenu(gcf,'label','&option');
5 x0 |3 h# d  H, n/ X/ q: \0 chgon=uimenu(hoption,'label',…$ w% {! J+ ~. y+ V! d9 u7 h
'&grid on','call','grid on','enable','off');
. Z# L9 q% r0 \hgoff=uimenu(hoption,'label',…
/ Z, G+ M* J3 z$ x9 l& M'&grid off','call','grid off','enable','off')$ G+ F  n# \' i- h" R/ ?) m
hbon=uimenu(hoption,'label','&box on'…" K" B/ D+ K; x4 Z: p5 p' ]
,'separator','on','call','box on','enable',…
, b2 W* s: L. b8 V' G2 R: X0 `'off')
1 n4 M3 t/ W; M: ?! z后面部分程序与上述有相似的效果,喜欢玩计算机的朋友可以转载哦…以后可能用着…谢谢看看
发表于 2013-4-27 11:47:47 | 显示全部楼层
啊哈哈,试试哦。有什么效果,就知道咯
您需要登录后才可以回帖 登录 | 注-册-帐-号

本版积分规则

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

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

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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