Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

我们为许可用户提供了部分翻译好的中文文档。您只需登录便可查阅这些文档

get

Query property values for audioplayer object

Syntax

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

Description

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.

Examples

Create an audioplayer object from the example file handel.mat and query the object properties:

load handel.mat;
handelObj = audioplayer(y, Fs);

% Display all properties.
get(handelObj)

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

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

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 handelObj (as created in the Example):

numSamples = handelObj.TotalSamples;

This command is exactly equivalent to:

numSamples = get(handelObj, 'TotalSamples');

See Also

|

Was this topic helpful?