This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

properties

Class property names

Syntax

properties(ClassName)
properties(obj)
p = properties(___)

Description

example

properties(ClassName) displays the names of the visible 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 = 4x1 cell array
    {'identifier'}
    {'message'   }
    {'cause'     }
    {'stack'     }

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

Introduced in R2008a