| Data Acquisition Toolbox | Search  Help Desk |
| set | Examples See Also |
Configure or display property values.
Syntax
set(obj)
props = set(obj)
set(obj, 'Property')
props = set(obj, 'Property')
set(obj, 'P1', V1, 'P2', V2,...)
set(obj, PN, PV)
set(obj, S)
Description
set(obj) displays all settable properties and their possible values.
props = set(obj) returns all settable properties and their possible values for obj to props. props is a structure array with fields given by the property names, and possible property values contained in cell arrays. if the property does not have a finite set of possible values, then the cell array is empty.
set(obj, 'Property') returns the valid values for Property.
props = set(obj, 'Property') returns the valid values for Property to props. props is a cell array of possible values or an empty cell array if the property does not have a finite set of possible values.
set(obj, 'P1', V1, 'P2', V2,...) sets multiple property values with a single statement. Note that you can use structures, property/value string pairs, and property name/property value cell array pairs in the same call to set.
set(obj, PN, PV) sets the properties specified in the cell array of strings PN to the corresponding values in the cell array PV. PN must be a vector. PV can be m-by-n where m is equal to the specified number of device objects, channels, or lines and n is equal to the length of PN.
set(obj, S), where S is a structure whose field names are device object properties, sets the properties named in each field name with the values contained in the structure.
Examples
Suppose you create the analog input objectai for a sound card and configure it to operate in stereo mode.
ai = analoginput('winsound')
addchannel(ai, 1:2)
To display all of ai's settable properties and their valid values
set(ai)
SampleRate property to 10000
set(ai, 'SampleRate', 10000)
SampleRate and InputType properties
You can also set different channel property values for multiple channels.set(ai, 'SampleRate', 10000, 'TriggerType', 'Manual')set(ai, {'SampleRate','TriggerType'}, {10000, 'Manual'})
ch = ai.Channel(1:2)
set(ch, {'UnitsRange','ChannelName'}, {[-1 1] 'Name1'; ...
[-2 2] 'Name2'})
See Also
Functions
get, setverify