getsample - Immediately acquire one sample

Syntax

sample = getsample(obj)

Arguments

obj

An analog input object.

sample

A row vector containing one sample for each channel contained by obj.

Description

sample = getsample(obj) immediately returns a row vector containing one sample for each channel contained by obj.

Remarks

Using getsample is a good way to test your analog input configuration. Additionally:

Examples

Create the analog input object ai and add eight channels to it.

ai = analoginput('nidaq','Dev1');
ch = addchannel(ai,0:7);

The following command returns one sample for each channel.

sample = getsample(ai);

See Also

Functions

getdata, peekdata

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS