% Matlab script to read data files for Lab 6.
% Rich Kozick, Spring 1997.

% Experiment 1: d = 17.375 inches

load data1.001 -ascii
t_1 = data1(:,1);     % Time values (sec.)
mic1_1 = data1(:,2);  % mic1 values
load data1.002 -ascii
mic2_1 = data1(:,2);  % mic2 values
clear data1
figure(1)
plot(t_1, mic1_1, t_1, mic2_1)
title('mic1 and mic2 for Exp. 1')

% Experiment 2: d = 34.5 inches

load data2.001 -ascii
t_2 = data2(:,1);     % Time values (sec.)
mic1_2 = data2(:,2);  % mic1 values
load data2.002 -ascii
mic2_2 = data2(:,2);  % mic2 values
clear data2
figure(2)
plot(t_2, mic1_2, t_1, mic2_2)
title('mic1 and mic2 for Exp. 2')

% Experiment 3a: d = 58 inches

load data3a.001 -ascii
t_3a = data3a(:,1);     % Time values (sec.)
mic1_3a = data3a(:,2);  % mic1 values
load data3a.002 -ascii
mic2_3a = data3a(:,2);  % mic2 values
clear data3a
figure(3)
plot(t_3a, mic1_3a, t_3a, mic2_3a)
title('mic1 and mic2 for Exp. 3a')

% Experiment 3b: d = 58 inches

load data3b.001 -ascii
t_3b = data3b(:,1);     % Time values (sec.)
mic1_3b = data3b(:,2);  % mic1 values
load data3b.002 -ascii
mic2_3b = data3b(:,2);  % mic2 values
clear data3b
figure(4)
plot(t_3b, mic1_3b, t_3b, mic2_3b)
title('mic1 and mic2 for Exp. 3b')
