数模论坛

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

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

  [复制链接]
发表于 2012-11-16 17:47:02 | 显示全部楼层 |阅读模式
命令如下:; {9 A. }; X1 Q. s
screen=get(0,'screensize');
9 W8 \. S! h6 d3 W: F! ?0 x9 t" \H=screen(4), W=screen(3);
/ }: b) R/ C" G) \, \- i4 d* }/ `figure('color','[1,1,1]','position','[0.2*H, …0.2*H,0.5*W,0.2*W]','name',…
. A) c  Q5 V' V/ n, E'图形演示系统','numbertitle','off',…2 g  ^, ]" ]7 C1 O* {7 j( H
'menubar','none');
7 [; d' y  m; @' y& V# `hplot=uimenu(gcf,'label','&plot');3 _. @; Q) i( x: {; K1 h
uimenu(hplot,'label','sine wave',…
' u7 a9 T1 E  ^* o, J'callback'['t=-pi:pi/20:2*pi;',…
8 k$ B2 g3 _6 @2 }'plot(t,sin(t))','set(ghon,"enable","on")';…
( z" l4 J! m6 {6 d' U: q'set(ghoff,"enable","on")';…! F8 V' X" v& \8 Q2 P5 E
'set(ghon,"enable","on")';…
; B' f7 A4 L, L5 I; ^9 ^4 l'set(ghoff,"enable","on")';]);
( H; d4 `: U% K9 S* i3 ?$ v. }8 ^uimenu(hplot,'label','consign wave';…
5 U  k! m  O, g8 s'callback',['t=-pi:pi/20:2*pi;',…
3 s. |1 o1 H# W, Z# Q2 k'plot(t,cos(t))','set(ghon,"enable",…
2 X) X1 J: o1 Q. Q: O* j  U"on")','set(ghoff,"enable","on"),…
1 t+ Y& p6 ~# J' k  s'set(ghon,"enable",…5 b) T5 M8 a9 @. z
"on")','set(ghoff,"enable","on")']);
  w3 D  z6 W0 a; a/ `* uhoption=uimenu(gcf,'label','&option');3 |! V4 {# \3 ]$ J
hgon=uimenu(hoption,'label',…9 r- l% u3 Q& W7 F; J3 A
'&grid on','call','grid on','enable','off');. t( _" l8 ^: ]' B6 w7 A7 g
hgoff=uimenu(hoption,'label',…
; N3 e" _8 T' J- `4 }$ q( j  B; n'&grid off','call','grid off','enable','off')
1 Y, {& @4 P8 Khbon=uimenu(hoption,'label','&box on'…# v5 D0 O% J$ J& z# r  X; R0 _9 y
,'separator','on','call','box on','enable',…5 k1 m, F  p, s+ X
'off'): u: {2 h# J- H3 d
后面部分程序与上述有相似的效果,喜欢玩计算机的朋友可以转载哦…以后可能用着…谢谢看看
发表于 2013-4-27 11:47:47 | 显示全部楼层
啊哈哈,试试哦。有什么效果,就知道咯
您需要登录后才可以回帖 登录 | 注-册-帐-号

本版积分规则

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

GMT+8, 2026-9-20 12:42 , Processed in 0.085548 second(s), 18 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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