| Data Acquisition Toolbox™ | ![]() |
Property characteristics for device objects, channels, or lines
out = propinfo(obj) out = propinfo(obj,'PropertyName')
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). |
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.
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 =
8000To 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![]() | peekdata | putdata | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |