
How to plot 3 membership function and find the µ of each one for a specific X ?
조회 수: 3 (최근 30일)
이전 댓글 표시
Hello ,
i want to plot 3 trapezoidal membership functions : the first one is : [ 0 0.3 0.4] second [0.3 0.4 0.6 0.7] third [0.6 0.7 1 ] like this

and i have a table of points that i want to plot here and get the membership function of each one i found how to do it with one function but not with 3 .
thank you for the help .
댓글 수: 0
채택된 답변
Sam Chak
2022년 6월 2일
편집: Sam Chak
2022년 6월 2일
Edit: To include the firing of fuzzy membership value μ corresponding to the x value,
x = 0:0.01:1;
y1 = trapmf(x, [-0.1 0.0 0.3 0.4]);
y2 = trapmf(x, [0.3 0.4 0.6 0.7]);
y3 = trapmf(x, [0.6 0.7 1.0 1.1]);
plot(x, y1, x, y2, x, y3, 'linewidth', 1.5)
hold on
xMark = 0.67;
y1Mark = trapmf(xMark, [-0.1 0.0 0.3 0.4]);
y2Mark = trapmf(xMark, [0.3 0.4 0.6 0.7]);
y3Mark = trapmf(xMark, [0.6 0.7 1.0 1.1]);
plot(xMark*x, y2Mark*ones(size(x)), '--', 'linewidth', 1.25)
plot(xMark*x, y3Mark*ones(size(x)), '--', 'linewidth', 1.25)
plot(xMark*ones(size(x)), y3Mark*x, '--', 'linewidth', 1.25)
hold off
grid on
ylim([-0.2 1.4])
xlabel('x')
ylabel('Degree of Membership, \mu')
legend('faible', 'moyenne', 'forte', 'location', 'best')

댓글 수: 4
Sam Chak
2022년 6월 2일
Thanks for your acceptance. I have edited the original Answer to include the firing of fuzzy membership value μ corresponding to the x value. I think you will like this, because you have more control over the plot.
추가 답변 (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!
