-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathLab3Utils.m
More file actions
32 lines (27 loc) · 909 Bytes
/
Lab3Utils.m
File metadata and controls
32 lines (27 loc) · 909 Bytes
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
classdef Lab3Utils
methods(Static)
function Y = EDistance(pointA, pointB)
Y = sqrt((pointA - pointB)' * (pointA - pointB));
end
function Y = ClassifyClass(Mus, point)
for i = 1:length(Mus)
distances(i) = Lab3Utils.EDistance(Mus(:,i),point);
if(Mus(:,i) == point)
temp = distances(i);
end
if(distances(i) ==0)
temp = distances(i);
end
end
[~, Y] = min(distances);
end
function Y = SimilarMeans(means1, means2)
Y = true;
for i = 1:size(means1,2)
if(Lab3Utils.EDistance(means1(:,i),means2(:,i)) <= 0.001)
Y = false;
end
end
end
end
end