-
Notifications
You must be signed in to change notification settings - Fork 5
/
createGaussian2MembershipFunction.m
63 lines (61 loc) · 2.61 KB
/
createGaussian2MembershipFunction.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
function mf = createGaussian2MembershipFunction(nMembership)
%% Create membership functions using a combination of two Gaussian membership functions
mf = [];
type = "gauss2mf";
if nMembership == 2
params = [0.3397 -0.1 0.3397 0.1;
0.3397 0.9 0.3397 1.1];
elseif nMembership == 3
params = [0.1699 -0.05 0.1699 0.05;
0.1699 0.45 0.1699 0.55
0.1699 0.95 0.1699 1.05];
elseif nMembership == 4
params = [0.1132 -0.03333 0.1132 0.03333;
0.1132 0.3 0.1132 0.3667;
0.1132 0.6333 0.1132 0.7;
0.1132 0.9667 0.1132 1.033];
elseif nMembership == 5
params = [0.08493 -0.025 0.08493 0.025;
0.08493 0.225 0.08493 0.275;
0.08493 0.475 0.08493 0.525;
0.08493 0.725 0.08493 0.775;
0.08493 0.975 0.08493 1.025];
elseif nMembership == 6
params = [0.06795 -0.02 0.06795 0.02;
0.06795 0.18 0.06795 0.22;
0.06795 0.38 0.06795 0.42;
0.06795 0.58 0.06795 0.62;
0.06795 0.78 0.06795 0.82;
0.06795 0.98 0.06795 1.02];
elseif nMembership == 7
params = [0.05662 -0.01667 0.05662 0.01667;
0.05662 0.15 0.05662 0.1833;
0.05662 0.3167 0.05662 0.35;
0.05662 0.4833 0.05662 0.5167;
0.05662 0.65 0.05662 0.6833;
0.05662 0.8167 0.05662 0.85;
0.05662 0.9833 0.05662 1.017];
elseif nMembership == 8
params = [0.04853 -0.01429 0.04853 0.01429;
0.04853 0.1286 0.04853 0.1571;
0.04853 0.2714 0.04853 0.3;
0.04853 0.4143 0.04853 0.4429;
0.04853 0.5571 0.04853 0.5857;
0.04853 0.7 0.04853 0.7286;
0.04853 0.8429 0.04853 0.8714;
0.04853 0.9857 0.04853 1.014];
elseif nMembership == 9
params = [0.04247 -0.0125 0.04247 0.0125;
0.04247 0.1125 0.04247 0.1375;
0.04247 0.2375 0.04247 0.2625;
0.04247 0.3625 0.04247 0.3875;
0.04247 0.4875 0.04247 0.5125;
0.04247 0.6125 0.04247 0.6375;
0.04247 0.7375 0.04247 0.7625;
0.04247 0.8625 0.04247 0.8875;
0.04247 0.9875 0.04247 1.012];
end
for i = 1:nMembership
mf = [mf ; fismf(type, params(i,:))];
end
end