Main Content

properties

Class property names

Description

example

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

example

properties(obj) displays the names of the public properties 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.

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.

Data Types: char | string

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

Public Properties

A property is public when its GetAccess attribute value is public and its Hidden attribute value is false (default values for these attributes). For a complete list of attributes, see Property Attributes.

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