function [ranges,knowledgeDataBase,MFs] = knowledgeDB (maxnumrows,matrix,clustering,i) |
calculate maximum from clustering; |
for j = 1: maximum |
k = find(clustering == j); |
aA = matrix(k); |
calculate min from aA; %this value is representing the value of b in the MF. |
calculate max from aA; %this value is representing the value of c in the MF. |
end |
if min from aA == max from aA |
MF(i) = ‘trimf’; |
calculate the point_a. Point_c is the same value of max from aA or min from aA. |
else |
MF(i) = ‘trapmf’; |
calculate the point_a and point_d for the Membership function. |
end |
knowledgeDataBase = [point_a Min(aA) Max(aA) point_d]; |
ranges = [min(aA) max(aA)]; |
MFs = MF; |
end |
end |