Documentation Center

  • Trial Software
  • Product Updates


Query property values for audiorecorder object


Value = get(obj,Name)
Values = get(obj,{Name1,...,NameN})
Values = get(obj)


Value = get(obj,Name) returns the value of the specified property for object obj.

Values = get(obj,{Name1,...,NameN}) returns the values of the specified properties in a 1-by-N cell array.

Values = get(obj) returns a scalar structure that contains the values of all properties of obj. Each field name corresponds to a property name.

get(obj) displays all property names and their current values.


Create an audiorecorder object and query the object properties:

recorderObj = audiorecorder;

% Display all properties.

% Display only the SampleRate property.
get(recorderObj, 'SampleRate')

% Create a cell array that contains
% values for two properties.
info = get(recorderObj, {'BitsPerSample', 'NumberOfChannels'});


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');

See Also


Was this topic helpful?