Quantcast

Documentation Center

  • Trial Software
  • Product Updates

propinfo

Property characteristics for device objects, channels, or lines

Syntax

out = propinfo(obj)
out = propinfo(obj,'PropertyName')

    Note:   You cannot use the legacy interface on 64–bit MATLAB®. See Session-Based Interface to acquire and generate data.

Arguments

obj

A device object, channels, or lines.

'PropertyName'

A valid obj property name.

out

A structure whose field names are the property names for obj (if PropertyName is not specified).

Description

out = propinfo(obj) returns the structure out whose field names are the property names for obj. Each property name in out contains the fields shown below.

Field Name

Description

Type

The property data type. Possible values are any, callback, double, and string.

Constraint

The type of constraint on the property value. Possible values are bounded, callback, enum, and none.

ConstraintValue

The property value constraint. The constraint can be a range of valid values or a list of valid string values.

DefaultValue

The property default value.

ReadOnly

Indicates when the property is read-only. Possible values are always, never, and whileRunning.

DeviceSpecific

If the property is device-specific, a 1 is returned. If a 0 is returned, the property is supported for all device objects of a given type.

out = propinfo(obj,'PropertyName') returns the structure out for the property specified by PropertyName. If PropertyName is a cell array of strings, a cell array of structures is returned for each property.

Examples

Create the analog input object ai for a sound card and configure it to operate in stereo mode.

ai = analoginput('winsound');
addchannel(ai,1:2);

To capture all property information for all common ai properties:

out = propinfo(ai);

To display the default value for the SampleRate property:

out.SampleRate.DefaultValue
ans =
        8000

To display all the property information for the InputRange property:

propinfo(ai.Channel,'InputRange')
ans = 
               Type: 'double'
         Constraint: 'Bounded'
    ConstraintValue: [-1 1]
       DefaultValue: [-1 1]
           ReadOnly: 'whileRunning'
     DeviceSpecific: 0

See Also

Was this topic helpful?