Code covered by the BSD License  

Highlights from
Educational Lab Report Data Acquisition Example

image thumbnail

Educational Lab Report Data Acquisition Example



13 Feb 2006 (Updated )

This is an example on how one might use the notebook feature to create a lab to do data acquisition

Editor's Notes:

This file was a File Exchange Pick of the Week

function  daqOutput = simpledaq(device,id,Fs)
%% Example data acquisition function
% This demonstration shows the procedure for acquiring data.
% This demo requires the Data Acquisition Toolbox

%% Create object
ai = analoginput(device,id);       % Create
addchannel(ai,1);                   % Add channel             

%% Configure
% Set the analog input parameters
vFs = setverify(ai,'samplerate',Fs);   %Configure

%% Start

%% Read data
[data time] = getdata(ai);

%% Disconnect / Clean up
clear ai  

%% Output data = data;
daqOutput.time = time;
daqOutput.sampleFrequency = vFs;

Contact us