-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdataProcessing.m
More file actions
108 lines (98 loc) · 2.95 KB
/
dataProcessing.m
File metadata and controls
108 lines (98 loc) · 2.95 KB
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
clc
clear all;
filename = 'F:\Software\omnetpp-4.6-src-windows\omnetpp-4.6\samples\OMNET_SimuLTE_framework-old\myPowerTest\results\General-0.sca';
[pathstr,name,ext] = fileparts(filename);
%newname = [pathstr filesep name ext]
%Tictoc{1} = importfile(filename)
single = 200;
min = 10;
max = 60;
interval = 10;
total = single * size(min:interval:max,2);
for i=0:total-1
part = num2str(i);
newname = strrep(name, '0', part);
newpath = [pathstr filesep newname ext];
Tictoc{i+1} = importfile1(newpath);
end
dataList = [];
dataNumberList = min:interval:max;
dataNumberList(2,:) = zeros(1,length(dataNumberList));
for i=1:total-1
tmp = Tictoc{i};
if (~isempty(tmp))
% newEntry = [tmp(1,2) tmp(2,2) tmp(3,2)];
newEntry = [tmp(1,2) tmp(2,2)];
dataList = [dataList; newEntry];
dataNumberList(2,floor(i/single)+1) = dataNumberList(2,floor(i/single)+1)+1;
%else
%newEntry = [10 10];
%dataList = [dataList; newEntry];
end
end
confidenceLevel = 0.90;
p = 1-(1-confidenceLevel)/2;
plotValue = [];
index = 1;
for totalLink=min:interval:max
data = dataList(index:index+dataNumberList(2,(totalLink-min)/interval+1)-1,2);
emean = mean(data);
estd = std(data);
t = tinv(p, single-1);
error = t*estd/sqrt(single);
newEntry = [totalLink; emean; error];
plotValue = [plotValue newEntry];
index = index+dataNumberList(2,(totalLink-min)/interval+1);
end
% For algorithm 1 comparison, time comparison
% plotTimeValue = [];
% index = 1;
% for totalLink=min:interval:max
% data = dataList(index:index+dataNumberList(2,(totalLink-min)/interval+1)-1,3);
% emean = mean(data);
% estd = std(data);
% t = tinv(p, single-1);
% error = t*estd/sqrt(single);
% newEntry = [totalLink; emean; error];
% plotTimeValue = [plotTimeValue newEntry];
% index = index+dataNumberList(2,(totalLink-min)/interval+1);
% end
% min = min(dataList(:,1));
% max = max(dataList(:,1));
%
% confidenceLevel = 0.90;
% p = 1-(1-confidenceLevel)/2;
%
% x = 1:max;
%
% totalLink = 50;
% index = find(dataList(:,1)==totalLink);
% plotValue = [];
% for totalLink=min:max
% index = find(dataList(:,1)==totalLink);
% if ~isempty(index)
% data = dataList(index,2);
% num = size(data,1);
% emean = mean(data');
% estd = std(data');
% t = tinv(p, num-1);
% error = t*estd/sqrt(num);
% % ub = emean+t*estd/sqrt(num);
% % lb = emean-t*estd/sqrt(num);
% if num~=1
% newEntry = [totalLink; emean; error];
% plotValue = [plotValue newEntry];
% end
%
% end
% end
% figure
% errorbar(plotValue(1,:), plotValue(2,:), plotValue(3,:))
% plotValueAlg1 = plotValue;
% save alg1_1000 plotValueAlg1
% d5060 = plotValue;
% save haha d5060 -append
plotValueAlg3 = plotValue;
save result plotValueAlg3 -append
% plotValueAlg1_phase1_200_Time = plotTimeValue;
% save result plotValueAlg1_phase1_200_Time -append