Main Content

get

Return MATLAB structure containing property settings of object or array of objects

Syntax

propList = get(thisObject,prop)

Description

The get function returns and displays a MATLAB® structure containing the settings for the specified property of this object. If no property is specified, the settings for all properties are returned.

The get function is also vectorized so that it returns an m-by-n cell array of values for an array of m objects and an array of n properties.

Arguments

thisObject

The object for which to get specified property.

prop

Name of property (e.g., 'FontSize') to get value for. Can also be an array of properties (see return propList below). If no property is specified, a list of all properties is returned.

Returns

propList

MATLAB structure listing the properties of this object. Can also be an m by n cell array of values if thisObject is an array of m objects and prop is an array of n properties.

Examples

State A is represented by the State object sA.

The following command lists the properties of state A:

get(sA)

The following command stores a struct with the properties of state A in the workspace variable AProperties:

AProperties = get(sA);
Introduced before R2006a