Bicycle Handle analysis

%%Prgrams were written by minster
%%in order to upload programs I combined all my programs into this giant
%%file
%%Please look at all attachments that I sent you via Email.

%%EMG.m –> EMG data
a=kcs4 (1:26000,2);
b=kcs4 (1:26000,3);
c=kcs4 (1:26000,4);
d=kcs4 (1:26000,5);
e=kcs4 (1:26000,6);
f=kcs4 (1:26000,7);
g=kcs4 (1:26000,8);
h=kcs4 (1:26000,9);
i=kcs4 (1:26000,10);
j=kcs4 (1:26000,11);
k=kcs4 (1:26000,12);
l=kcs4 (1:26000,13);

figure(1)
plot(a);
title (‘EMG Signal of Right O.D.M/A.P.M’);
xlabel (‘Frame (2000/sec)’);
ylabel (‘ mV’);
grid on;

figure(2)
plot(b);
title (‘EMG Signal of Right F.P.L’);
xlabel (‘Frame (2000/sec)’);
ylabel (‘ mV’);
grid on;

figure(3)
plot(c);
title (‘EMG Signal of Right Biceps’);
xlabel (‘Frame (2000/sec)’);
ylabel (‘ mV’);
grid on;

figure(4)
plot(d);
title (‘EMG Signal of Right Rhomboidminar’);
xlabel (‘Frame (2000/sec)’);
ylabel (‘ mV’);
grid on;

figure(5)
plot(e);
title (‘EMG Signal of Right Thoracolumbar fascia’);
xlabel (‘Frame (2000/sec)’);
ylabel (‘ mV’);
grid on;

figure(6)
plot(f);
title (‘EMG Signal of Right Serratus P.I.M’);
xlabel (‘Frame (2000/sec)’);
ylabel (‘ mV’);
grid on;

figure(7)
plot(g);
title (‘EMG Signal of Left Serratus P.I.M’);
xlabel (‘Frame (2000/sec)’);
ylabel (‘ mV’);
grid on;

figure(8)
plot(h);
title (‘EMG Signal of Left Thoracolumbar fascia’);
xlabel (‘Frame (2000/sec)’);
ylabel (‘ mV’);
grid on;

figure(9)
plot(i);
title (‘EMG Signal of Left Biceps’);
xlabel (‘Frame (2000/sec)’);
ylabel (‘ mV’);
grid on;

figure(10)
plot(j);
title (‘EMG Signal of Right F.P.L’);
xlabel (‘Frame (2000/sec)’);
ylabel (‘ mV’);
grid on;

figure(11)
plot(k);
title (‘EMG Signal of Left F.P.L’);
xlabel (‘Frame (2000 Frames/sec)’);
ylabel (‘ mV’);
grid on;

figure(12)
plot(l);
title (‘EMG Signal of Left O.D.M/A.P.M’);
xlabel (‘Frame (2000 Frames/sec)’);
ylabel (‘ mV’);
grid on;

figure(13) %right wrist and left wrist
subplot (2,1,1)
plot(a)
title (‘EMG Signal of Right O.D.M/A.P.M’);
xlabel(‘Frames (2000 frames/sec)’);
ylabel(‘mV’);
grid on;
hold all;
subplot (2,1,2)
plot(l)
title (‘EMG Signal of Left O.D.M/A.P.M’);
xlabel(‘Frames (2000 frames/sec)’);
ylabel(‘mV’);
grid on;

%%dataglove.m –> finger movement data
t=X04_angle_stand(1:1578,1);
a=X04_angle_stand(1:1578,2);
b=X04_angle_stand(1:1578,3);
c=X04_angle_stand(1:1578,4);
d=X04_angle_stand(1:1578,5);
e=X04_angle_stand(1:1578,6);
f=X04_angle_stand(1:1578,7);
g=X04_angle_stand(1:1578,8);
h=X04_angle_stand(1:1578,9);
i=X04_angle_stand(1:1578,10);
j=X04_angle_stand(1:1578,11);
k=X04_angle_stand(1:1578,12);
l=X04_angle_stand(1:1578,13);
m=X04_angle_stand(1:1578,14);
n=X04_angle_stand(1:1578,15);

figure(1)
subplot(5,3,1);figure(gcf)
plot (t,a);
xlabel({‘timestamp’});
ylabel({‘Resistance’});
grid on;

hold all;

subplot(5,3,2);figure(gcf)
plot (t,b);
xlabel({‘timestamp’});
ylabel({‘Resistance’});
grid on;
subplot(5,3,3);figure(gcf)
plot (t,c);
xlabel({‘timestamp’});
ylabel({‘Resistance’});
grid on;
subplot(5,3,4);figure(gcf)
plot (t,d);
xlabel({‘timestamp’});
ylabel({‘Resistance’});
grid on;
subplot(5,3,5);figure(gcf)
plot (t,e);
xlabel({‘timestamp’});
ylabel({‘Resistance’});
grid on;
subplot(5,3,6);figure(gcf)
plot (t,f);
xlabel({‘timestamp’});
ylabel({‘Resistance’});
grid on;
subplot(5,3,7);figure(gcf)
plot (t,g);
xlabel({‘timestamp’});
ylabel({‘Resistance’});
grid on;
subplot(5,3,8);figure(gcf)
plot (t,h);
xlabel({‘timestamp’});
ylabel({‘Resistance’});
grid on;
subplot(5,3,9);figure(gcf)
plot (t,h);
xlabel({‘timestamp’});
ylabel({‘Resistance’});
grid on;
subplot(5,3,10);figure(gcf)
plot (t,i);
xlabel({‘timestamp’});
ylabel({‘Resistance’});
grid on;
subplot(5,3,11);figure(gcf)
plot (t,j);
xlabel({‘timestamp’});
ylabel({‘Resistance’});
grid on;
subplot(5,3,12);figure(gcf)
plot (t,k);
xlabel({‘timestamp’});
ylabel({‘Resistance’});
grid on;
subplot(5,3,13);figure(gcf)
plot (t,l);
xlabel({‘timestamp’});
ylabel({‘Resistance’});
grid on;
subplot(5,3,14);figure(gcf)
plot (t,m);
xlabel({‘timestamp’});
ylabel({‘Resistance’});
grid on;
subplot(5,3,15);figure(gcf)
plot (t,n);
xlabel({‘timestamp’});
ylabel({‘Resistance’});
grid on;

figure(2)
subplot (1,3,1); figure(gcf)
plot (X04_angle_stand(1:1578,1:6), ‘DisplayName’,’X05_angle_sit(1:1578,1:6)’, ‘YDataSource’, ‘X05_angle_sit(1:1578,1:4)’); figure(gcf)
hold all;
xlabel({‘timestamp’});
ylabel({‘Resistance’});
grid on;

subplot (1,3,2);
plot (X04_angle_stand(1:1578,7:10), ‘DisplayName’,’X05_angle_sit(1:1578,7:10)’, ‘YDataSource’, ‘X05_angle_sit(1:1578,7:10)’); figure(gcf)
xlabel({‘timestamp’});
ylabel({‘Resistance’});
grid on;

subplot(1,3,3);
plot (X04_angle_stand(1:1578,11:15), ‘DisplayName’,’X05_angle_sit(1:1578,11:15)’, ‘YDataSource’, ‘X05_angle_sit(1:1578,11:15)’); figure(gcf)
xlabel({‘timestamp’});
ylabel({‘Resistance’});
grid on;

figure(3)
plot (t,a);
hold all;
grid on;
xlabel (‘timestamp’);
ylabel (‘resistance’);
title (‘Subject 4 with angle stand posture’);
plot (t,b);
plot (t,c);
plot (t,d);
plot (t,e);
plot (t,f);
plot (t,g);
plot (t,h);
plot (t,i);
plot (t,j);
plot (t,k);
plot (t,l);
plot (t,m);
plot (t,n);

%%data.m

for i = 1:1:8
for j = 1:1:301
if (angle3_new.Y(1,i).Data(1,j)) > 4.3
angle3_new.Y(1,i).Data(1,j) = 0
else
angle3_new.Y(1,i).Data(1,j) = ((angle3_new.Y(1,i).Data(1,j))*-1) +4.3
end
end
end
a=angle3_new.Y(1,1).Data(1,1:301);
b=angle3_new.Y(1,2).Data(1,1:301);
c=angle3_new.Y(1,3).Data(1,1:301);
d=angle3_new.Y(1,4).Data(1,1:301);
e=angle3_new.Y(1,5).Data(1,1:301);
f=angle3_new.Y(1,6).Data(1,1:301);
g=angle3_new.Y(1,7).Data(1,1:301);
h=angle3_new.Y(1,8).Data(1,1:301);

figure(1)
plot (a, ‘DisplayName’, ‘subject3_noangleangle3_new.Y(1,1).Data(1,1:301)’, ‘YDataSource’, ‘subject1_02.Y(1,1).Data(1,1:601)’ )% figure(gcf)
grid on;
figure(2)
plot (b, ‘DisplayName’, ‘subject3_noangleangle3_new.Y(1,1).Data(1,1:301)’, ‘YDataSource’, ‘subject1_04.Y(1,1).Data(1,1:301)’)
grid on;
figure(3)
plot (c, ‘DisplayName’, ‘subject3_noangleangle3_new.Y(1,1).Data(1,1:301)’, ‘YDataSource’, ‘subject1_04.Y(1,1).Data(1,1:301)’)
grid on;
figure(4)
plot (d, ‘DisplayName’, ‘subject3_noangleangle3_new.Y(1,1).Data(1,1:301)’, ‘YDataSource’, ‘subject1_04.Y(1,1).Data(1,1:301)’)
grid on;
figure(5)
plot (e, ‘DisplayName’, ‘subject3_noangleangle3_new.Y(1,1).Data(1,1:301)’, ‘YDataSource’, ‘subject1_04.Y(1,1).Data(1,1:301)’)
grid on;
figure(6)
plot (f, ‘DisplayName’, ‘subject3_noangleangle3_new.Y(1,1).Data(1,1:301)’, ‘YDataSource’, ‘subject1_04.Y(1,1).Data(1,1:301)’)
grid on;
figure(7)
plot (g, ‘DisplayName’, ‘subject3_noangleangle3_new.Y(1,1).Data(1,1:301)’, ‘YDataSource’, ‘subject1_04.Y(1,1).Data(1,1:301)’)
grid on;
figure(8)
plot (h, ‘DisplayName’, ‘subject3_noangleangle3_new.Y(1,1).Data(1,1:301)’, ‘YDataSource’, ‘subject1_04.Y(1,1).Data(1,1:301)’)
grid on;
figure(9)
subplot(611);
plot (a, ‘DisplayName’, ‘subject3_noangleangle3_new.Y(1,1).Data(1,1:301)’, ‘YDataSource’, ‘subject1_02.Y(1,1).Data(1,1:601)’ );
grid on;
hold all;
subplot(612);
plot (b, ‘DisplayName’, ‘subject3_noangleangle3_new.Y(1,1).Data(1,1:301)’, ‘YDataSource’, ‘subject1_04.Y(1,1).Data(1,1:301)’)
grid on;
subplot(613);
plot (c, ‘DisplayName’, ‘subject3_noangleangle3_new.Y(1,1).Data(1,1:301)’, ‘YDataSource’, ‘subject1_04.Y(1,1).Data(1,1:301)’)
grid on;
subplot(614);
plot (e, ‘DisplayName’, ‘subject3_noangleangle3_new.Y(1,1).Data(1,1:301)’, ‘YDataSource’, ‘subject1_04.Y(1,1).Data(1,1:301)’)
grid on;
subplot(615);
plot (g, ‘DisplayName’, ‘subject3_noangleangle3_new.Y(1,1).Data(1,1:301)’, ‘YDataSource’, ‘subject1_04.Y(1,1).Data(1,1:301)’)
grid on;
subplot(616);
plot (f, ‘DisplayName’, ‘subject3_noangleangle3_new.Y(1,1).Data(1,1:301)’, ‘YDataSource’, ‘subject1_04.Y(1,1).Data(1,1:301)’)
grid on;

figure(10)
subplot(211);
%ch4
plot (d, ‘DisplayName’, ‘subject3_noangleangle3_new.Y(1,1).Data(1,1:301)’, ‘YDataSource’, ‘subject1_04.Y(1,1).Data(1,1:301)’)
grid on;
subplot(212);
%ch6
plot (h, ‘DisplayName’, ‘subject3_noangleangle3_new.Y(1,1).Data(1,1:301)’, ‘YDataSource’, ‘subject1_04.Y(1,1).Data(1,1:301)’)
grid on;

% for right hand angles
t=X14_angle3(1:1578,1);
a1=X14_angle3(1:1578,2);
b1=X14_angle3(1:1578,3);
c1=X14_angle3(1:1578,4);
d1=X14_angle3(1:1578,5);
e1=X14_angle3(1:1578,6);
f1=X14_angle3(1:1578,7);
g1=X14_angle3(1:1578,8);
h1=X14_angle3(1:1578,9);
i1=X14_angle3(1:1578,10);
j1=X14_angle3(1:1578,11);
k1=X14_angle3(1:1578,12);
l1=X14_angle3(1:1578,13);
m1=X14_angle3(1:1578,14);
n1=X14_angle3(1:1578,15);

figure(11)
subplot(5,3,1);figure(gcf)
plot (t,a1);
xlabel({‘timestamp’});
ylabel({‘Resistance’});
grid on;

hold all;

subplot(5,3,2);figure(gcf)
plot (t,b1);
xlabel({‘timestamp’});
ylabel({‘Resistance’});
grid on;
subplot(5,3,3);figure(gcf)
plot (t,c1);
xlabel({‘timestamp’});
ylabel({‘Resistance’});
grid on;
subplot(5,3,4);figure(gcf)
plot (t,d1);
xlabel({‘timestamp’});
ylabel({‘Resistance’});
grid on;
subplot(5,3,5);figure(gcf)
plot (t,e1);
xlabel({‘timestamp’});
ylabel({‘Resistance’});
grid on;
subplot(5,3,6);figure(gcf)
plot (t,f1);
xlabel({‘timestamp’});
ylabel({‘Resistance’});
grid on;
subplot(5,3,7);figure(gcf)
plot (t,g1);
xlabel({‘timestamp’});
ylabel({‘Resistance’});
grid on;
subplot(5,3,8);figure(gcf)
plot (t,h1);
xlabel({‘timestamp’});
ylabel({‘Resistance’});
grid on;
subplot(5,3,9);figure(gcf)
plot (t,i1);
xlabel({‘timestamp’});
ylabel({‘Resistance’});
grid on;
subplot(5,3,10);figure(gcf)
plot (t,j1);
xlabel({‘timestamp’});
ylabel({‘Resistance’});
grid on;
subplot(5,3,11);figure(gcf)
plot (t,k1);
xlabel({‘timestamp’});
ylabel({‘Resistance’});
grid on;
subplot(5,3,12);figure(gcf)
plot (t,l1);
xlabel({‘timestamp’});
ylabel({‘Resistance’});
grid on;
subplot(5,3,13);figure(gcf)
plot (t,m1);
xlabel({‘timestamp’});
ylabel({‘Resistance’});
grid on;
subplot(5,3,14);figure(gcf)
plot (t,n1);
xlabel({‘timestamp’});
ylabel({‘Resistance’});
grid on;

figure(12)
subplot (1,3,1);
plot (X14_angle3(1:1578,2:6), ‘DisplayName’,’X05_angle_angle3_new(1:1578,2:6)’, ‘YDataSource’, ‘X05_angle_angle3_new(1:1578,1:4)’); figure(gcf)
hold all;
xlabel({‘timestamp’});
ylabel({‘Resistance’});
grid on;

subplot (1,3,2);
plot (X14_angle3(1:1578,7:11), ‘DisplayName’,’X05_angle_angle3_new(1:1578,7:10)’, ‘YDataSource’, ‘X05_angle_angle3_new(1:1578,7:10)’); figure(gcf)
xlabel({‘timestamp’});
ylabel({‘Resistance’});
grid on;

subplot(1,3,3);
plot (X14_angle3(1:1578,12:15), ‘DisplayName’,’X05_angle_angle3_new(1:1578,11:15)’, ‘YDataSource’, ‘X05_angle_angle3_new(1:1578,11:15)’); figure(gcf)
xlabel({‘timestamp’});
ylabel({‘Resistance’});
grid on;

figure(13)
plot (t,a1);
hold all;
grid on;
xlabel (‘timestamp’);
ylabel (‘resistance’);
title (‘Subject 4 with angle angle3_new posture’);
plot (t,b1);
plot (t,c1);
plot (t,d1);
plot (t,e1);
plot (t,f1);
plot (t,g1);
plot (t,h1);
plot (t,i1);
plot (t,j1);
plot (t,k1);
plot (t,l1);
plot (t,m1);
plot (t,n1);

%%ave.m
%a=lgy6 (1:20000,5);
%b=hys6 (1:20000,5);
c=kcs7 (1:20000,5);
d=khj7 (1:20000,5);
e=yj7 (1:20000,5);
f=(c+e+d)/3;

%g=lgy5 (1:20000,10);
%h=hys5 (1:20000,10);
i=kcs7 (1:20000,10);
j=khj7 (1:20000, 10);
k=yj7 (1:20000, 10);
l=(i+j+k)/3;

figure(1)
subplot(2,1,1)
plot(f);
grid on;
title (‘Right A.P.M Average EMG signal’);
xlabel (‘Frame (2000/sec)’);
ylabel (‘ mV’);
hold all;

subplot(2,1,2)
plot(l);
title (‘Left A.P.M Average EMG signal’);
xlabel (‘Frame (2000/sec)’);
ylabel (‘ mV’);
grid on;

%%angle
a=es2 (1:618,1);
b=es2 (1:618,2);
c=es2 (1:618,3);
plot(a);
hold all;
plot(b);
plot(c);
grid on;