function crab_analysis

% Filename: crab_analysis.m
% Class:    function
% Author:   John Ramsey
% Date:     April 2002
% Version:  Matlab 6.0
% Usage:    crab_analysis
% Info:     reads Microvision .anl file to plot the data contained in the file

close all;

% load the data files
load crab_d1_1_430_V2.5.anl
load crab_d1_1_430_V5.anl
load crab_d1_3_430_V2.5.anl
load crab_d1_3_430_V5.anl
load crab_d1_4_430_V2.5.anl
load crab_d1_4_430_V5.anl
load crab_d1_5_430_V2.5.anl
load crab_d1_5_430_V5.anl

% assign data to variables
f = crab_d1_1_430_V5(:,1)

y12 = crab_d1_1_430_V2(:,4)
y15 = crab_d1_1_430_V5(:,4)
y32 = crab_d1_3_430_V2(:,4)
y35 = crab_d1_3_430_V5(:,4)
y42 = crab_d1_4_430_V2(:,4)
y45 = crab_d1_4_430_V5(:,4)
y52 = crab_d1_5_430_V2(:,4)
y55 = crab_d1_5_430_V5(:,4)


% plot the data
% plot for V = 5
figure
semilogy(f,y15,f,y35,f,y45,f,y55)
title('Y Magnitude Response, Vac = 5 V')
xlabel('Frequency (Hz)'), ylabel('Displacement (m)')
legend('crab1','crab3','crab4','crab5')

% plot for V = 5
figure
semilogy(f,y15,f,y35,f,y45,f,y55)
title('Y Magnitude Response, Vac = 5 V')
xlabel('Frequency (Hz)'), ylabel('Displacement (m)')
legend('crab1','crab3','crab4','crab5')
axis([5.25e4,6e4,2e-7,5e-6])

% plot for V = 2.5
figure
semilogy(f,y12,f,y32,f,y42,f,y52)
title('Y Magnitude Response, Vac = 2.5 V')
xlabel('Frequency (Hz)'), ylabel('Displacement (m)')
legend('crab1','crab3','crab4','crab5')

% plot for V = 2.5
figure
semilogy(f,y12,f,y32,f,y42,f,y52)
title('Y Magnitude Response, Vac = 2.5 V')
xlabel('Frequency (Hz)'), ylabel('Displacement (m)')
legend('crab1','crab3','crab4','crab5')
axis([5.25e4,6e4,1e-7,2e-5])

% plot for crab 1
figure
semilogy(f,y12,f,y15)
title('Y Magnitude Response, Crab 1')
xlabel('Frequency (Hz)'), ylabel('Displacement (m)')
legend('2.5 V','5 V')
axis([5.25e4,6e4,10^-7,10^-5])

% plot for crab 3
figure
semilogy(f,y32,f,y35)
title('Y Magnitude Response, Crab 3')
xlabel('Frequency (Hz)'), ylabel('Displacement (m)')
legend('2.5 V','5 V')
axis([5e4,6.5e4,10^-7,10^-5])

% plot for crab 4
figure
semilogy(f,y42,f,y45)
title('Y Magnitude Response, Crab 4')
xlabel('Frequency (Hz)'), ylabel('Displacement (m)')
legend('2.5 V','5 V')
axis([5e4,6.5e4,10^-7,10^-5])

% plot for crab 5
figure
semilogy(f,y52,f,y55)
title('Y Magnitude Response, Crab 5')
xlabel('Frequency (Hz)'), ylabel('Displacement (m)')
legend('2.5 V','5 V')
axis([5e4,6.5e4,10^-7,10^-5])