Data Acquisition Toolbox    

Acquiring Data

If you have a sound card installed, you can run the following example, which acquires one second of data from two analog input hardware channels, and then plots the acquired data.

You should modify this example to suit your specific application needs. If you want detailed information about acquiring data, refer to Doing More with Analog Input.

  1. Create a device object -- Create the analog input object ai for a sound card.
  2. Add channels -- Add two hardware channels to ai.
  3. Configure property values -- Configure the sampling rate to 44.1 kHz and collect 1 second of data (44,100 samples) for each channel.
  4. Acquire data -- Start the acquisition. When all the data is acquired, ai automatically stops executing.
  5. Clean up -- When you no longer need ai, you should remove it from memory and from the MATLAB workspace.

  Accessing Your Hardware Outputting Data