Code covered by the BSD License  

Highlights from
Educational Lab Report Data Acquisition Example

image thumbnail

Educational Lab Report Data Acquisition Example

by

 

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

createplots(x1, y1, x2, y2)
function createplots(x1, y1, x2, y2)
%CREATEFIGURE(X1,Y1,X2,Y2)
%  X1:  vector of x data
%  Y1:  vector of y data
%  X2:  vector of x data
%  Y2:  vector of y data
 
%  Auto-generated by MATLAB on 06-Feb-2006 15:14:23
 
%% Create figure
figure1 = figure;
 
%% Create axes
axes1 = axes('Position',[0.13 0.1152 0.775 0.3286],'Parent',figure1);
title(axes1,'Frequency Components');
xlabel(axes1,'Frequency (Hz)');
ylabel(axes1,'Magnitude (dB)');
box(axes1,'on');
grid(axes1,'on');
hold(axes1,'all');
 
%% Create plot
plot1 = plot(x1,y1,'Parent',axes1);
 
%% Create axes
axes2 = axes('Position',[0.13 0.589 0.775 0.3286],'Parent',figure1);
ylim(axes2,[-0.15 0.15]);
title(axes2,'Raw Measurement');
xlabel(axes2,'Time (sec)');
ylabel(axes2,'Voltage (v)');
box(axes2,'on');
hold(axes2,'all');
 
%% Create plot
plot2 = plot(x2,y2,'Parent',axes2);
 

Contact us