-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathobserveT.m
58 lines (44 loc) · 1.25 KB
/
observeT.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
% Observe T and T'.
InputFileName = 'result8.csv';
OutputFileName = 'observeT8.csv';
% A W k ER ER1 ER2 T T_ MT
% skip the title
mat = csvread(InputFileName, 1, 0);
AW = sortMat(:, 1) .* sortMat(:, 2);
Ak = sortMat(:, 1) .* sortMat(:, 3);
AER = sortMat(:, 1) .* sortMat(:, 4);
Wk = sortMat(:, 2) .* sortMat(:, 3);
WER = sortMat(:, 2) .* sortMat(:, 4);
kER = sortMat(:, 3) .* sortMat(:, 4);
T = sortMat(:, 7);
T_ = sortMat(:, 8);
avgT = sortMat(:, 9) ./ 2;
dt = abs(T - T_) ./ 2 ./ avgT;
newSortMat = sortrows([sortMat dt], 10);
subplot(2, 2, 1);
plot(newSortMat(:, 1), '.');
title('Subplot1: A ');
subplot(2, 2, 2);
plot(newSortMat(:, 2), '.');
title('Subplot2: W ');
subplot(2, 2, 3);
plot(newSortMat(:, 3), '.');
title('Subplot3: k ');
subplot(2, 2, 4);
plot(newSortMat(:, 4), '.');
title('Subplot4: ER ');
% sort by the result and plot it.
newSortMat = sortrows(newSortMat, -1);
newSortMat = sortrows(newSortMat, 2);
figure;
plot(newSortMat(:, 10));
title('Plot: first W then A ');
newSortMat = sortrows(newSortMat, 2);
newSortMat = sortrows(newSortMat, -1);
figure;
plot(newSortMat(:, 10));
title('Plot: first A then W ');
fid = fopen(OutputFileName, 'w');
fprintf(fid, 'A,W,k,ER,ER1,ER2,T,T'',MT,DT\n');
fclose(fid);
dlmwrite(OutputFileName, newSortMat, '-append');