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

How to disable the output of set command in matlab Command Window?

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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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 ]

我想避免在命令窗口中得到这个输出。我正在使用以下代码:

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

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


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

1
 set( p, 'PropertyName', Value )

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