get
Class: matlab.mixin.SetGet
Namespace: matlab.mixin
Query specified property values
Syntax
CV = get(H,Name)
SV = get(H)
get(H)
Description
returns the values of the named property from the objects in the handle array
CV
= get(H
,Name
)H
. If H
is scalar, get
returns a single value; if H
is an array, get
returns a cell array of property values. get
matches partial and
case-insensitive names that are not ambiguous. Inexact name matching applies only to
class properties. Dynamic properties require exact name matches.
If you specify a cell array of property names as the second argument, then get
returns a cell array of values, where each row in the cell corresponds to an element in H
and each column in the cell corresponds to an element in the property name cell array.
If H
is nonscalar and Name
is the name of a dynamic property, get
returns a value only if the property exists in all objects referenced in H
.
returns a structure in which the field names are the object's property names and the values are the current values of the corresponding properties. If SV
= get(H
)H
is nonscalar, then SV
is a numel(H)
-by-1
array of structures.
get(
displays all property names and their current values for the MATLAB® objects with handle H
)H
.
Your subclass can override the matlab.mixin.SetGet
getdisp
method to control how MATLAB displays this information.
Input Arguments
Output Arguments
Examples
Get the value of a property named Data
from an instance of a class derived from matlab.mixin.SetGet
.
propValue = get(obj,'Data');
Tips
Override the
matlab.mixin.SetGet
classgetdisp
method to change how MATLAB displays information returned byget
.