| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Data Acquisition Toolbox |
| Contents | Index |
| Learn more about Data Acquisition Toolbox |
sample = getsample(obj)
obj | An analog input object. |
sample | A row vector containing one sample for each channel contained by obj. |
sample = getsample(obj) immediately returns a row vector containing one sample for each channel contained by obj.
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.
You can execute getsample at any time after channels have been added to obj.
getsample is not supported for sound cards and Dynamic Signal Acquisition and Generation (DSA) cards.
Note Refer to the Vendor Limitations section before you access National Instruments devices with the NI-DAQmx adaptor simultaneously from multiple applications. |
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);
![]() | getdata | getvalue | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |