Data Acquisition with the Data Acquisition Toolbox

These examples will show how to acquire data from a DAQ using the Data Acquisition Toolbox. Since this functionality is not supported for code generation, this functionality is best used when running MATLAB functions and Simulink models directly on a desktop computer.



There are many different DAQ units. The primary vendors are Analog Devices and NI. A sound card is also considered a DAQ and can be used for sampling. Use the following website to determine what data acquisition hardware is supported:

Hardware Support for Data Acquisition Toolbox


To acquire analog or audio data from a DAQ in MATLAB, use the following functions:

First, to create a data acquisition session:

Second, to add an input channel:

And third, to acquire data:


To acquire analog or audio data from a DAQ in Simulink, use the following blocks:



There are multiple examples in the documentation showing how to acquire data from a data acquisition board.

MATLAB Examples

Foreground vs. Background

Analog vs. Audio

Simulink Examples