properties - Class property names - MATLAB (original) (raw)
Main Content
Syntax
Description
properties([ClassName](#d126e1420859))
displays the names of non-hidden properties with public GetAccess
for the MATLAB® class, including inherited properties.
properties([obj](#d126e1420878))
displays the names of non-hidden properties with public GetAccess
for the object or object array. When obj
is scalar, properties
also returns dynamic properties. When obj
is an array,properties
returns the properties of the class of the array.
[p](#d126e1420902) = properties(___)
returns the property names in a cell array of character vectors.
Examples
List the properties of a class using the class name.
Properties for class memmapfile:
Filename
Writable
Offset
Format
Repeat
Data
List the public properties of an MException object.
me = MException('Msg:ID','MsgText'); p = properties(me)
p = 5×1 cell {'identifier'} {'message' } {'cause' } {'stack' } {'Correction'}
Input Arguments
Name of the class whose properties you want to query, specified as a character vector or string scalar.
Object of the class whose properties you want to query, specified as an object or array of objects.
Output Arguments
Property names returned as a cell array of character vector.
More About
The word properties
is also a MATLAB class-definition keyword. See classdef for more information on class definition keywords.
Extended Capabilities
Usage notes and limitations:
- The function call
properties(obj)
is supported for code generation only ifobj
is an instance of a MATLAB class defined in a.m
file. - The order in which the code generated for the function
properties
returns the properties of an object might be different from MATLAB execution.
Version History
Introduced in R2008a