Main Content

properties

Class property names

Description

properties(ClassName) displays the names of non-hidden properties with public GetAccess for the MATLAB® class, including inherited properties.

example

properties(obj) 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.

example

p = properties(___) returns the property names in a cell array of character vectors.

example

Examples

collapse all

List the properties of a class using the class name.

properties memmapfile
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 = 5x1 cell
    {'identifier'}
    {'message'   }
    {'cause'     }
    {'stack'     }
    {'Correction'}

Input Arguments

collapse all

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

collapse all

Property names returned as a cell array of character vector.

More About

collapse all

Properties Keyword

The word properties is also a MATLAB class-definition keyword. See classdef for more information on class definition keywords.

Extended Capabilities

Version History

Introduced in R2008a