function crab_analysis2

% Filename: crab_analysis2.m
% Class:    function
% Author:   John Ramsey
% Date:     May 2002
% Version:  Matlab 6.0
% Usage:    crab_analysis2
% 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

load crab_d5_1_509_V2.5.anl
load crab_d5_1_509_V5.anl
load crab_d5_1_509_V5b.anl
load crab_d5_2_509_V2.5.anl
load crab_d5_2_509_V5.anl
load crab_d5_2_509_V5b.anl
load crab_d5_3_509_V2.5.anl
load crab_d5_3_509_V5.anl
load crab_d5_3_509_V5b.anl
load crab_d5_4_509_V2.5.anl
load crab_d5_4_509_V5.anl
load crab_d5_4_509_V5b.anl
load crab_d5_5_509_V2.5.anl
load crab_d5_5_509_V5.anl
load crab_d5_5_509_V5b.anl

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

y1_12 = crab_d1_1_430_V2(:,4);
y1_15 = crab_d1_1_430_V5(:,4);
y1_32 = crab_d1_3_430_V2(:,4);
y1_35 = crab_d1_3_430_V5(:,4);
y1_42 = crab_d1_4_430_V2(:,4);
y1_45 = crab_d1_4_430_V5(:,4);
y1_52 = crab_d1_5_430_V2(:,4);
y1_55 = crab_d1_5_430_V5(:,4);

f5_1   = crab_d5_1_509_V2(:,1);
y5_12  = crab_d5_1_509_V2(:,4);
y5_15  = crab_d5_1_509_V5(:,4);
f5_1b  = crab_d5_1_509_V5b(:,1);
y5_15b = crab_d5_1_509_V5b(:,4);

f5_2   = crab_d5_2_509_V2(:,1);
y5_22  = crab_d5_2_509_V2(:,4);
y5_25  = crab_d5_2_509_V5(:,4);
f5_2b  = crab_d5_2_509_V5b(:,1);
y5_25b = crab_d5_2_509_V5b(:,4);

f5_3   = crab_d5_3_509_V2(:,1);
y5_32  = crab_d5_3_509_V2(:,4);
y5_35  = crab_d5_3_509_V5(:,4);
f5_3b  = crab_d5_3_509_V5b(:,1);
y5_35b = crab_d5_3_509_V5b(:,4);

f5_4   = crab_d5_4_509_V2(:,1);
y5_42  = crab_d5_4_509_V2(:,4);
y5_45  = crab_d5_4_509_V5(:,4);
f5_4b  = crab_d5_4_509_V5b(:,1);
y5_45b = crab_d5_4_509_V5b(:,4);

f5_5   = crab_d5_5_509_V2(:,1);
y5_52  = crab_d5_5_509_V2(:,4);
y5_55  = crab_d5_5_509_V5(:,4);
f5_5b  = crab_d5_5_509_V5b(:,1);
y5_55b = crab_d5_5_509_V5b(:,4);


% plot the data
% plot for die 5, V = 5
figure
semilogy(f5_1,y5_15,f5_2,y5_25,f5_3,y5_35,f5_4,y5_45,f5_5,y5_55)
title('Die 5, Y Magnitude Response, Vac = 5 V')
xlabel('Frequency (Hz)'), ylabel('Displacement (m)')
legend('d5crab1','d5crab2','d5crab3','d5crab4','d5crab5')

% plot for both, V = 5
figure
semilogy(f,y1_15,f,y1_35,f,y1_45,f,y1_55,f5_1,y5_15,f5_2,y5_25,f5_3,y5_35,f5_4,y5_45,f5_5,y5_55)
title('Y Magnitude Response, Vac = 5 V')
xlabel('Frequency (Hz)'), ylabel('Displacement (m)')
legend('d1crab1','d1crab3','d1crab4','d1crab5','d5crab1','d5crab2','d5crab3','d5crab4','d5crab5')
%axis([5.25e4,6e4,2e-7,5e-6])

% plot for die 5, V = 2.5
figure
semilogy(f5_1,y5_12,f5_2,y5_22,f5_3,y5_32,f5_4,y5_42,f5_5,y5_52)
title('Die 5, Y Magnitude Response, Vac = 2.5 V')
xlabel('Frequency (Hz)'), ylabel('Displacement (m)')
legend('d5crab1','d5crab2','d5crab3','d5crab4','d5crab5')

% plot for both, V = 2.5
figure
semilogy(f,y1_12,f,y1_32,f,y1_42,f,y1_52,f5_1,y5_12,f5_2,y5_22,f5_3,y5_32,f5_4,y5_42,f5_5,y5_52)
title('Y Magnitude Response, Vac = 2.5 V')
xlabel('Frequency (Hz)'), ylabel('Displacement (m)')
legend('d1crab1','d1crab3','d1crab4','d1crab5','d5crab1','d5crab2','d5crab3','d5crab4','d5crab5')
%axis([5.25e4,6e4,1e-7,2e-5])

% plot for crab 1
figure
semilogy(f,y1_12,f,y1_15, f5_1, y5_12, f5_1, y5_15, f5_1b, y5_15b)
title('Y Magnitude Response, Crab 1')
xlabel('Frequency (Hz)'), ylabel('Displacement (m)')
legend('d1 2.5 V','d1 5 V','d5 2.5V','d5 5V','d5 5Vb')
axis([5.25e4,6e4,10^-7,10^-5])

% plot for crab 2
figure
semilogy(f5_2, y5_22, f5_2, y5_25, f5_2b, y5_25b)
title('Y Magnitude Response, Crab 2')
xlabel('Frequency (Hz)'), ylabel('Displacement (m)')
legend('d5 2.5V','d5 5V','d5 5Vb')
axis([5e4,6.5e4,10^-7,10^-5])

% plot for crab 3
figure
semilogy(f,y1_32,f,y1_35, f5_3, y5_32, f5_3, y5_35, f5_3b, y5_35b)
title('Y Magnitude Response, Crab 3')
xlabel('Frequency (Hz)'), ylabel('Displacement (m)')
legend('d1 2.5 V','d1 5 V','d5 2.5V','d5 5V','d5 5Vb')
axis([5e4,6.5e4,10^-7,10^-5])

% plot for crab 4
figure
semilogy(f,y1_42,f,y1_45, f5_4, y5_42, f5_4, y5_45, f5_4b, y5_45b)
title('Y Magnitude Response, Crab 4')
xlabel('Frequency (Hz)'), ylabel('Displacement (m)')
legend('d1 2.5 V','d1 5 V','d5 2.5V','d5 5V','d5 5Vb')
axis([5e4,6.5e4,10^-7,10^-5])

% plot for crab 5
figure
semilogy(f,y1_52,f,y1_55, f5_5, y5_52, f5_5, y5_55, f5_5b, y5_55b)
title('Y Magnitude Response, Crab 5')
xlabel('Frequency (Hz)'), ylabel('Displacement (m)')
legend('d1 2.5 V','d1 5 V','d5 2.5V','d5 5V','d5 5Vb')
axis([5e4,6.5e4,10^-7,10^-5])

% plot for d1,V = 5
%figure
%semilogy(f,y1_15,f,y1_35,f,y1_45,f,y1_55)
%title('Die 1, Y Magnitude Response, Vac = 5 V')
%xlabel('Frequency (Hz)'), ylabel('Displacement (m)')
%legend('crab1','crab3','crab4','crab5')

% plot for d1, V = 5
%figure
%semilogy(f,y1_15,f,y1_35,f,y1_45,f,y1_55)
%title('Die 1, 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 d1, V = 2.5
%figure
%semilogy(f,y1_12,f,y1_32,f,y1_42,f,y1_52)
%title('Die 1, Y Magnitude Response, Vac = 2.5 V')
%xlabel('Frequency (Hz)'), ylabel('Displacement (m)')
%legend('crab1','crab3','crab4','crab5')

% plot for d1, V = 2.5
%figure
%semilogy(f,y1_12,f,y1_32,f,y1_42,f,y1_52)
%title('Die 1, 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 d1, crab 1
%figure
%semilogy(f,y1_12,f,y1_15)
%title('Die 1, 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 d1, crab 3
%figure
%semilogy(f,y1_32,f,y1_35)
%title('Die 1, 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 d1, crab 4
%figure
%semilogy(f,y1_42,f,y1_45)
%title('Die 1, 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 d1, crab 5
%figure
%semilogy(f,y1_52,f,y1_55)
%title('Die 1, 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])