如何在matlab命令窗口中禁用set命令的输出?

时间:2013-11-18 15:12:17

标签: matlab matlab-figure

我正在尝试set图形对象的属性,当我执行我的代码时,我得到该图形对象的属性列表。我试图在set命令的末尾添加分号,但它没有帮助我。有没有办法避免在命令窗口中输出set命令?

BackgroundColor
Color
DisplayName
EdgeColor
Editing: [ on | off ]
FontAngle: [ {normal} | italic | oblique ]
FontName
FontSize
FontUnits: [ inches | centimeters | normalized | {points} | pixels ]
FontWeight: [ light | {normal} | demi | bold ]
HorizontalAlignment: [ {left} | center | right ]
LineStyle: [ {-} | -- | : | -. | none ]
LineWidth
Margin
Position
Rotation
String
Units: [ inches | centimeters | normalized | points | pixels | characters | {data} ]
Interpreter: [ latex | {tex} | none ]
VerticalAlignment: [ top | cap | {middle} | baseline | bottom ]

ButtonDownFcn: string -or- function handle -or- cell array
Children
Clipping: [ {on} | off ]
CreateFcn: string -or- function handle -or- cell array
DeleteFcn: string -or- function handle -or- cell array
BusyAction: [ {queue} | cancel ]
HandleVisibility: [ {on} | callback | off ]
HitTest: [ {on} | off ]
Interruptible: [ {on} | off ]
Parent
Selected: [ on | off ]
SelectionHighlight: [ {on} | off ]
Tag
UIContextMenu
UserData
Visible: [ {on} | off ]

我想避免在命令窗口中获取此输出。我使用以下代码:

p = mtit ('Global Title') ;
set (p) ;

mtit是在 Matlab Central FileExchange 上找到的方法,用于显示子图的公共标题。

1 个答案:

答案 0 :(得分:5)

命令set(p)未设置p的任何属性。实际设置p属性的正确语法是

 set( p, 'PropertyName', Value )

仅键入set(p)时,您会输入所有属性值信息(您不想要)...