| Data Acquisition Toolbox | ![]() |
Return the length of a device object, channel group, or line group
Syntax
out = length(obj)out = length(obj.Channel)out = length(obj.Line)
Arguments
obj |
A device object or array of device objects. |
obj.Channel |
The channels contained by obj. |
obj.Line |
The lines contained by obj. |
out |
A double. |
Description
returns the length of the device object out = length(obj)
obj to out.
returns the length of the channel group contained by out = length(obj.Channel)
obj.
returns the length of the line group contained by out = length(obj.Line)
obj.
Example
Create the analog input object ai for a National Instruments board and add eight channels to it.
ai = analoginput('nidaq',1);
aich = addchannel(ai,0:7);
Create the analog output object ao for a National Instruments board, add one channel to it, and create the device object array aiao.
ao = analogoutput('nidaq',1);
aoch = addchannel(ao,0);
aiao = [ai ao]
Index: Subsystem: Name:
1 Analog Input nidaq1-AI
2 Analog Output nidaq1-AO
length(aiao)
ans =
2
To find the length of the analog input channel group
length(aich)
ans =
8
Functions
| isvalid | load | ![]() |