| Data Acquisition Toolbox | ![]() |
Immediately acquire one sample
Syntax
Arguments
obj |
An analog input object. |
sample |
A row vector containing one sample for each channel contained by obj. |
Description
immediately returns a row vector containing one sample for each channel contained by sample = getsample(obj)
obj.
Remarks
Using getsample is a good way to test your analog input configuration. Additionally:
getsample does not store samples in, or extract samples from, the data acquisition engine.
getsample at any time after channels have been added to obj.
getsample on an analog input object that is not running (Running is Off). For sound cards, the device object must be running.
Example
Create the analog input object ai and add eight channels to it.
The following command returns one sample for each channel.
Functions
| getdata | getvalue | ![]() |