get
Query property values for audiorecorder
object
Syntax
Value
= get(obj
,Name
)
Values
= get(obj
,{Name1
,...,NameN
})
Values
= get(obj
)
get(obj
)
Description
returns the value of the specified property for object Value
= get(obj
,Name
)obj
.
returns the values of the specified properties in a 1-by-Values
= get(obj
,{Name1
,...,NameN
})N
cell
array.
returns a scalar structure that contains the values of all properties
of Values
= get(obj
)obj
. Each field name corresponds to
a property name.
get(
displays
all property names and their current values.obj
)
Examples
Create an audiorecorder
object and query
the object properties:
recorderObj = audiorecorder; % Display all properties. get(recorderObj) % Display only the SampleRate property. get(recorderObj, 'SampleRate') % Create a cell array that contains % values for two properties. info = get(recorderObj, {'BitsPerSample', 'NumChannels'});
Alternatives
To access a single property, you can use dot notation. Reference
each property as though it is a field of a structure array. For example,
find the value of the TotalSamples
property for
an object named recorderObj
(as created in the
Example):
numSamples = recorderObj.TotalSamples;
This command is exactly equivalent to:
numSamples = get(recorderObj, 'TotalSamples');