-
Notifications
You must be signed in to change notification settings - Fork 0
/
ComputeCMC.m
39 lines (26 loc) · 857 Bytes
/
ComputeCMC.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
% Calcola i valori della curva CMC.
function [ output ] = ComputeCMC( input_args )
indexes = input_args;
cmc = zeros(1, size(indexes,1));
probesIndexes = zeros(1, size(indexes,2));
for i = 1 : size(indexes,2)
probesIndexes(1,i) = i;
end
for i = 1 : size(indexes,1)
rank = 1;
result = 1;
for j = 1 : size(indexes,2)
if( indexes(i,j) == probesIndexes(1,i))
rank = result;
else
result = result+1;
end
end
for j = rank : size(cmc, 2)
cmc(1,j) = cmc(1,j) + 1;
end
end
normalize = cast(size(probesIndexes,2),'double');
cmc = cast(cmc,'double') / normalize;
output = cmc;
end