数模论坛

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

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

  [复制链接]
发表于 2012-11-16 17:47:02 | 显示全部楼层 |阅读模式
命令如下:
2 _" c7 o* y- m. Q: R( e0 escreen=get(0,'screensize');
* R  I9 q$ t# K# W. \; MH=screen(4), W=screen(3);
! g, M+ d' \2 [+ ?9 _' Ofigure('color','[1,1,1]','position','[0.2*H, …0.2*H,0.5*W,0.2*W]','name',…
7 F/ v7 [6 _+ L8 K- C5 Z. U'图形演示系统','numbertitle','off',…
' _; D) T# t, f/ O'menubar','none');9 @! j  b# V- H# g1 b: t9 m! j
hplot=uimenu(gcf,'label','&plot');
/ z9 J. Z  a; Uuimenu(hplot,'label','sine wave',…
: C8 G/ w5 ~$ t4 E'callback'['t=-pi:pi/20:2*pi;',…7 \6 R* {+ ?* l7 V* I
'plot(t,sin(t))','set(ghon,"enable","on")';…4 H4 a5 N" P% l3 y- U
'set(ghoff,"enable","on")';…
7 l6 C1 z& ~4 w# E7 `4 {'set(ghon,"enable","on")';…
9 B* O2 v& h: \- V'set(ghoff,"enable","on")';]);
- T9 H9 Z+ [% C9 `* `- Duimenu(hplot,'label','consign wave';…
8 F. W4 j/ `+ C4 }'callback',['t=-pi:pi/20:2*pi;',…2 i, `! ^* e3 T4 p4 l* Y6 X
'plot(t,cos(t))','set(ghon,"enable",…
) u  b  y8 z  ~7 Y" d: {( Z. t"on")','set(ghoff,"enable","on"),…
( X( `8 ]! t0 I+ `'set(ghon,"enable",…
1 {% x0 k! J) _7 a' }"on")','set(ghoff,"enable","on")']);
. i5 \7 p) |$ E4 E+ [! \hoption=uimenu(gcf,'label','&option');! s3 p" }2 P- y$ ]7 _  W* X3 B5 f: l* J
hgon=uimenu(hoption,'label',…
3 l- c& r+ c7 w+ B'&grid on','call','grid on','enable','off');
- O1 p! Z4 g5 Ehgoff=uimenu(hoption,'label',…
. O* J+ W0 |/ r- w( X2 G'&grid off','call','grid off','enable','off')" w6 ~% e/ V, \& R6 G: D
hbon=uimenu(hoption,'label','&box on'…" b4 r6 H7 U. L# f$ @8 p  v5 n
,'separator','on','call','box on','enable',…$ m+ ?: k/ @- R4 m
'off')2 \9 _$ V, s3 p) ?9 c# ]9 o8 s8 ^
后面部分程序与上述有相似的效果,喜欢玩计算机的朋友可以转载哦…以后可能用着…谢谢看看
发表于 2013-4-27 11:47:47 | 显示全部楼层
啊哈哈,试试哦。有什么效果,就知道咯
您需要登录后才可以回帖 登录 | 注-册-帐-号

本版积分规则

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

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

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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