-
Notifications
You must be signed in to change notification settings - Fork 0
/
DataAnalysis.m
143 lines (118 loc) · 8.79 KB
/
DataAnalysis.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
close all
clear all
clc
% EstimatedQTask1 = load('EstimatedAngles/EstimatedQArmGiuseppeBacchettaOLD.mat');
% EstimatedQTask2 = load('EstimatedAngles/EstimatedQArmGiuseppecapelliOLD.mat');
% EstimatedQTask3 = load('EstimatedAngles/EstimatedQArmGiuseppeCapelli2OLD.mat');
% EstimatedQTask4 = load('EstimatedAngles/EstimatedQArmGiuseppeMouseOLD.mat');
% EstimatedQTask5 = load('EstimatedAngles/EstimatedQArmGiuseppeSaliOLD.mat');
% EstimatedQTask6 = load('EstimatedAngles/EstimatedQArmGiuseppeSalutareOLD.mat');
% EstimatedQTask7 = load('EstimatedAngles/EstimatedQArmGiuseppeScendiOLD.mat');
% EstimatedQTask8 = load('EstimatedAngles/EstimatedQArmGiuseppeSpostarebottigliaOLD.mat');
% EstimatedQTask9 = load('EstimatedAngles/EstimatedQArmGiuseppeTazzinaOLD.mat');
% EstimatedQTask10 = load('EstimatedAngles/EstimatedQArmGiuseppeTelefonoOLD.mat');
%
% EstimatedQTask1 = EstimatedQTask1.EstimatedQ;
% EstimatedQTask2 = EstimatedQTask2.EstimatedQ;
% EstimatedQTask3 = EstimatedQTask3.EstimatedQ;
% EstimatedQTask4 = EstimatedQTask4.EstimatedQ;
% EstimatedQTask5 = EstimatedQTask5.EstimatedQ;
% EstimatedQTask6 = EstimatedQTask6.EstimatedQ;
% EstimatedQTask7 = EstimatedQTask7.EstimatedQ;
% EstimatedQTask8 = EstimatedQTask8.EstimatedQ;
% EstimatedQTask9 = EstimatedQTask9.EstimatedQ;
% EstimatedQTask10 = EstimatedQTask10.EstimatedQ;
EstimatedQTask1 = load('EstimatedAngles/EstimatedQArmGiuseppeg1.mat');
EstimatedQTask2 = load('EstimatedAngles/EstimatedQArmGiuseppeg2.mat');
EstimatedQTask3 = load('EstimatedAngles/EstimatedQArmGiuseppeg3.mat');
EstimatedQTask4 = load('EstimatedAngles/EstimatedQArmGiuseppeg4.mat');
EstimatedQTask5 = load('EstimatedAngles/EstimatedQArmGiuseppeg5.mat');
EstimatedQTask6 = load('EstimatedAngles/EstimatedQArmGiuseppeg6.mat');
EstimatedQTask7 = load('EstimatedAngles/EstimatedQArmGiuseppeg7.mat');
EstimatedQTask8 = load('EstimatedAngles/EstimatedQArmGiuseppe1.mat');
EstimatedQTask9 = load('EstimatedAngles/EstimatedQArmGiuseppe4.mat');
EstimatedQTask10 = load('EstimatedAngles/EstimatedQArmGiuseppe9.mat');
EstimatedQTask1 = EstimatedQTask1.EstimatedQ;
EstimatedQTask2 = EstimatedQTask2.EstimatedQ;
EstimatedQTask3 = EstimatedQTask3.EstimatedQ;
EstimatedQTask4 = EstimatedQTask4.EstimatedQ;
EstimatedQTask5 = EstimatedQTask5.EstimatedQ;
EstimatedQTask6 = EstimatedQTask6.EstimatedQ;
EstimatedQTask7 = EstimatedQTask7.EstimatedQ;
EstimatedQTask8 = EstimatedQTask8.EstimatedQ;
EstimatedQTask9 = EstimatedQTask9.EstimatedQ;
EstimatedQTask10 = EstimatedQTask10.EstimatedQ;
%q1 = [EstimatedQTask1(1,:);EstimatedQTask2(1,:);EstimatedQTask3(1,:);...
% EstimatedQTask4(1,:);EstimatedQTask5(1,:);EstimatedQTask6(1,:);...
% EstimatedQTask7(1,:);EstimatedQTask8(1,:);EstimatedQTask9(1,:);EstimatedQTask10(1,:)];
figure;hold on;plot(EstimatedQTask1(1,:)','r-','LineWidth',2);plot(EstimatedQTask2(1,:)','g-','LineWidth',2);...
plot(EstimatedQTask3(1,:)','b-','LineWidth',2);plot(EstimatedQTask4(1,:)','k-','LineWidth',2);...
plot(EstimatedQTask5(1,:)','k--','LineWidth',2);plot(EstimatedQTask6(1,:)','c-','LineWidth',2);...
plot(EstimatedQTask7(1,:)','m-','LineWidth',2);plot(EstimatedQTask8(1,:)','y--','LineWidth',2);...
plot(EstimatedQTask9(1,:)','r--','LineWidth',2);plot(EstimatedQTask10(1,:)','g--','LineWidth',2);
title('q1')
figure;hold on;plot(EstimatedQTask1(2,:)','r-','LineWidth',2);plot(EstimatedQTask2(2,:)','g-','LineWidth',2);...
plot(EstimatedQTask3(2,:)','b-','LineWidth',2);plot(EstimatedQTask4(2,:)','k-','LineWidth',2);...
plot(EstimatedQTask5(2,:)','k--','LineWidth',2);plot(EstimatedQTask6(2,:)','c-','LineWidth',2);...
plot(EstimatedQTask7(2,:)','m-','LineWidth',2);plot(EstimatedQTask8(2,:)','y--','LineWidth',2);...
plot(EstimatedQTask9(2,:)','r--','LineWidth',2);plot(EstimatedQTask10(2,:)','g--','LineWidth',2);
title('q2')
figure;hold on;plot(EstimatedQTask1(3,:)','r-','LineWidth',2);plot(EstimatedQTask2(3,:)','g-','LineWidth',2);...
plot(EstimatedQTask3(3,:)','b-','LineWidth',2);plot(EstimatedQTask4(3,:)','k-','LineWidth',2);...
plot(EstimatedQTask5(3,:)','k--','LineWidth',2);plot(EstimatedQTask6(3,:)','c-','LineWidth',2);...
plot(EstimatedQTask7(3,:)','m-','LineWidth',2);plot(EstimatedQTask8(3,:)','y--','LineWidth',2);...
plot(EstimatedQTask9(3,:)','r--','LineWidth',2);plot(EstimatedQTask10(3,:)','g--','LineWidth',2);
title('q3')
figure;hold on;plot(EstimatedQTask1(4,:)','r-','LineWidth',2);plot(EstimatedQTask2(4,:)','g-','LineWidth',2);...
plot(EstimatedQTask3(4,:)','b-','LineWidth',2);plot(EstimatedQTask4(4,:)','k-','LineWidth',2);...
plot(EstimatedQTask5(4,:)','k--','LineWidth',2);plot(EstimatedQTask6(4,:)','c-','LineWidth',2);...
plot(EstimatedQTask7(4,:)','m-','LineWidth',2);plot(EstimatedQTask8(4,:)','y--','LineWidth',2);...
plot(EstimatedQTask9(4,:)','r--','LineWidth',2);plot(EstimatedQTask10(4,:)','g--','LineWidth',2);
title('q4')
figure;hold on;plot(EstimatedQTask1(5,:)','r-','LineWidth',2);plot(EstimatedQTask2(5,:)','g-','LineWidth',2);...
plot(EstimatedQTask3(5,:)','b-','LineWidth',2);plot(EstimatedQTask4(5,:)','k-','LineWidth',2);...
plot(EstimatedQTask5(5,:)','k--','LineWidth',2);plot(EstimatedQTask6(5,:)','c-','LineWidth',2);...
plot(EstimatedQTask7(5,:)','m-','LineWidth',2);plot(EstimatedQTask8(5,:)','y--','LineWidth',2);...
plot(EstimatedQTask9(5,:)','r--','LineWidth',2);plot(EstimatedQTask10(5,:)','g--','LineWidth',2);
title('q5')
figure;hold on;plot(EstimatedQTask1(6,:)','r-','LineWidth',2);plot(EstimatedQTask2(6,:)','g-','LineWidth',2);...
plot(EstimatedQTask3(6,:)','b-','LineWidth',2);plot(EstimatedQTask4(6,:)','k-','LineWidth',2);...
plot(EstimatedQTask5(6,:)','k--','LineWidth',2);plot(EstimatedQTask6(6,:)','c-','LineWidth',2);...
plot(EstimatedQTask7(6,:)','m-','LineWidth',2);plot(EstimatedQTask8(6,:)','y--','LineWidth',2);...
plot(EstimatedQTask9(6,:)','r--','LineWidth',2);plot(EstimatedQTask10(6,:)','g--','LineWidth',2);
title('q6')
figure;hold on;plot(EstimatedQTask1(7,:)','r-','LineWidth',2);plot(EstimatedQTask2(7,:)','g-','LineWidth',2);...
plot(EstimatedQTask3(7,:)','b-','LineWidth',2);plot(EstimatedQTask4(7,:)','k-','LineWidth',2);...
plot(EstimatedQTask5(7,:)','k--','LineWidth',2);plot(EstimatedQTask6(7,:)','c-','LineWidth',2);...
plot(EstimatedQTask7(7,:)','m-','LineWidth',2);plot(EstimatedQTask8(7,:)','y--','LineWidth',2);...
plot(EstimatedQTask9(7,:)','r--','LineWidth',2);plot(EstimatedQTask10(7,:)','g--','LineWidth',2);
title('q7')
Q1 = [EstimatedQTask1(1,:) EstimatedQTask2(1,:) EstimatedQTask3(1,:) EstimatedQTask4(1,:)...
EstimatedQTask5(1,:) EstimatedQTask6(1,:) EstimatedQTask7(1,:) EstimatedQTask8(1,:)...
EstimatedQTask9(1,:) EstimatedQTask10(1,:)];
Q2 = [EstimatedQTask1(2,:) EstimatedQTask2(2,:) EstimatedQTask3(2,:) EstimatedQTask4(2,:)...
EstimatedQTask5(2,:) EstimatedQTask6(2,:) EstimatedQTask7(2,:) EstimatedQTask8(2,:)...
EstimatedQTask9(2,:) EstimatedQTask10(2,:)];
Q3 = [EstimatedQTask1(3,:) EstimatedQTask2(3,:) EstimatedQTask3(3,:) EstimatedQTask4(3,:)...
EstimatedQTask5(3,:) EstimatedQTask6(3,:) EstimatedQTask7(3,:) EstimatedQTask8(3,:)...
EstimatedQTask9(3,:) EstimatedQTask10(3,:)];
Q4 = [EstimatedQTask1(4,:) EstimatedQTask2(4,:) EstimatedQTask3(4,:) EstimatedQTask4(4,:)...
EstimatedQTask5(4,:) EstimatedQTask6(4,:) EstimatedQTask7(4,:) EstimatedQTask8(4,:)...
EstimatedQTask9(4,:) EstimatedQTask10(4,:)];
Q5 = [EstimatedQTask1(5,:) EstimatedQTask2(5,:) EstimatedQTask3(5,:) EstimatedQTask4(5,:)...
EstimatedQTask5(5,:) EstimatedQTask6(5,:) EstimatedQTask7(5,:) EstimatedQTask8(5,:)...
EstimatedQTask9(5,:) EstimatedQTask10(5,:)];
Q6 = [EstimatedQTask1(6,:) EstimatedQTask2(6,:) EstimatedQTask3(6,:) EstimatedQTask4(6,:)...
EstimatedQTask5(6,:) EstimatedQTask6(6,:) EstimatedQTask7(6,:) EstimatedQTask8(6,:)...
EstimatedQTask9(6,:) EstimatedQTask10(6,:)];
Q7 = [EstimatedQTask1(7,:) EstimatedQTask2(7,:) EstimatedQTask3(7,:) EstimatedQTask4(7,:)...
EstimatedQTask5(7,:) EstimatedQTask6(7,:) EstimatedQTask7(7,:) EstimatedQTask8(7,:)...
EstimatedQTask9(7,:) EstimatedQTask10(7,:)];
Dataset = [Q1' Q2' Q3' Q4' Q5' Q6' Q7' ];
coders={'PC1','PC2','PC3','PC4','PC5','PC6','PC7'};
[coeff,score,latent,tsquared,explained,mu] = pca(Dataset);
figure;pareto(explained,coders)
axis([0.5 7.5 0 100])
xlabel('Principal Component')
ylabel('Variance Explained (%)')
title(strcat('Varianza spiegata.'))