数模论坛

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

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

  [复制链接]
发表于 2012-11-16 17:47:02 | 显示全部楼层 |阅读模式
命令如下:; t4 s: a6 M$ \9 ]; B& U9 {' a
screen=get(0,'screensize');* v. ~" O, L/ f7 j  g6 I2 q' G
H=screen(4), W=screen(3);$ f: d  r( _/ m- m2 M- \/ Q+ j2 {
figure('color','[1,1,1]','position','[0.2*H, …0.2*H,0.5*W,0.2*W]','name',…
, t$ G' [, U1 L+ k% e$ {& q. n'图形演示系统','numbertitle','off',…9 Y& k! S4 ~% M, E# W( ]
'menubar','none');
0 j5 p- E$ h) j" c1 ]1 `, O8 ghplot=uimenu(gcf,'label','&plot');
1 j0 p; |5 G8 S: z  c+ nuimenu(hplot,'label','sine wave',…$ |3 U, k- u, N% L
'callback'['t=-pi:pi/20:2*pi;',…5 L1 Z2 c" B$ d7 a; `" o
'plot(t,sin(t))','set(ghon,"enable","on")';…0 @6 W8 @, D. h# s. d7 Z! m# y* c( H
'set(ghoff,"enable","on")';…
. ~: [% k  u  Y6 U6 G0 [# x'set(ghon,"enable","on")';…; _2 R0 E0 A2 K3 _& I) V' F
'set(ghoff,"enable","on")';]);
3 }, E" K6 b+ f) ~: ouimenu(hplot,'label','consign wave';…
: O& f8 Z7 s7 n9 b% y8 d'callback',['t=-pi:pi/20:2*pi;',…
* r6 C0 J" i0 Z8 F% T% h) _& @'plot(t,cos(t))','set(ghon,"enable",…
1 _3 `& o- U+ B$ [0 H"on")','set(ghoff,"enable","on"),…7 ]. R/ ?" C' |, {+ K
'set(ghon,"enable",…% h" e2 K) F- l4 b5 _. l* w
"on")','set(ghoff,"enable","on")']);& Z1 o' w" J: W
hoption=uimenu(gcf,'label','&option');% W& s$ l# a3 \$ ~+ I. L
hgon=uimenu(hoption,'label',…3 W+ r; E  h* b( _4 v
'&grid on','call','grid on','enable','off');. ?. o  F! m# r3 Z, @8 a
hgoff=uimenu(hoption,'label',…
+ K. a7 h# h: W- W'&grid off','call','grid off','enable','off')
; Y! q2 Q. ^/ H1 a' @4 z5 p/ B5 ahbon=uimenu(hoption,'label','&box on'…! ^6 H5 A9 W' s
,'separator','on','call','box on','enable',…
0 D# @  w0 s" w- q$ W- y'off')" ?% B4 O, w* O: x+ U3 H
后面部分程序与上述有相似的效果,喜欢玩计算机的朋友可以转载哦…以后可能用着…谢谢看看
发表于 2013-4-27 11:47:47 | 显示全部楼层
啊哈哈,试试哦。有什么效果,就知道咯
您需要登录后才可以回帖 登录 | 注-册-帐-号

本版积分规则

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

GMT+8, 2026-4-15 12:26 , Processed in 0.077344 second(s), 19 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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