properties
Returns public property names for an object or class.
📝Syntax
properties(h)
c = properties(h)
c = properties(obj)
c = properties(className)
📥Input Arguments
Parameter Description
h a handle object
obj a classdef object
className a class name as a string, including package-qualified names
📤Output Arguments
Parameter Description
c a cell of strings
📄Description

properties returns a cell of strings with public property names.

For classdef classes, private, protected, and access-list-restricted properties are hidden from this list. Constant properties can be accessed as ClassName.PropertyName.

For classdef object arrays, properties returns the public properties of the array element class.

Dependent properties and automatic observable property events are parsed as attributes, but compatible get/set dispatch and automatic property notifications are still limited.

💡Examples
List public properties of a classdef object array.
clear classes
d = [tempdir(), 'nelson_help_properties/'];
mkdir(d);
filewrite([d, '/NelsonHelpPropertiesPoint.m'], ["classdef NelsonHelpPropertiesPoint"; "  properties"; "    X = 0"; "  end"; "end"]);
addpath(d);
a = NelsonHelpPropertiesPoint();
b = NelsonHelpPropertiesPoint();
p = properties([a, b])
🔗See Also
ispropclassdef
🕔Version History
Version Description
1.0.0 initial version
2.0.0 classdef class name support added
2.0.0 classdef object array support added
Edit this page on GitHub