The value of membership functions for x
조회 수: 2 (최근 30일)
이전 댓글 표시
hi
how to define the output fuzzy set as fuzzy values - which mean's that the outputs membership functions multi-valued as in picture below .
So in Matlab for example I want to ses the MF value for the input X.
Which code or function should use to have the values of MF as outputs if x is a vector e.g. x= [2 5.5 23 14 6.5 7 9 20]?
Thanks in advance
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/202927/image.jpeg)
댓글 수: 0
답변 (1개)
Sam Chak
2022년 9월 16일
To obtain the fuzzy set values, the evalmf() function can be used. In this example, the fuzzy sets are constructed using the Gaussian Membership functions:
x = 0:0.1:25;
mf1 = fismf("gaussmf", [2, 0]);
mf2 = fismf("gaussmf", [2, 5]);
mf3 = fismf("gaussmf", [2, 10]);
mf4 = fismf("gaussmf", [2, 15]);
mf5 = fismf("gaussmf", [2, 20]);
y1 = evalmf(mf1, x);
y2 = evalmf(mf2, x);
y3 = evalmf(mf3, x);
y4 = evalmf(mf4, x);
y5 = evalmf(mf5, x);
plot(x, [y1; y2; y3; y4; y5]'), grid on, ylim([-0.2 1.2]), xlabel('\it{x}'), ylabel('\mu(\it{x})')
If we want to find the MF values over specific input values in x, then the following syntax is used:
X = [2 5.5 23 14 6.5 7 9 20];
Y1 = evalmf(mf1, X)
Y2 = evalmf(mf2, X)
Y3 = evalmf(mf3, X)
Y4 = evalmf(mf4, X)
Y5 = evalmf(mf5, X)
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Fuzzy Logic Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!