Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

properties

Class property names

Syntax

properties('classname')
properties(obj)
p = properties(...)

Description

properties('classname') displays the names of the public properties for the MATLAB® class named by classname. The properties function also displays inherited properties.

properties(obj) obj can be either a scalar object or an array of objects. When obj is scalar, properties also returns dynamic properties. See Dynamic Properties — Adding Properties to an Instance for information on using dynamic properties.

p = properties(...) returns the property names in a cell array of strings.

Definitions

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

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

Examples

Retrieve the names of the public properties of class memmapfile and store the result in a cell array of strings:

p = properties('memmapfile')
p =

    'writable'
    'offset'
    'format'
    'repeat'
    'filename'

Construct an instance of the MException class and get its properties names:

me = MException('Msg:ID','MsgText');
properties(me)
Properties for class MException:

    identifier
    message
    cause
    stack

Related Examples

See Also

| |

Was this topic helpful?