How to get the fuzzy value of an input when the crisp value is given
조회 수: 12 (최근 30일)
이전 댓글 표시
I have implemented a fuzzy logic system using toolbox. I want to get the fuzzy value of the crisp input using matlab code. Can you please help me to do this.
댓글 수: 0
답변 (1개)
Sam Chak
2022년 9월 18일
The evalmf() function can used in this situation.
help evalmf
x = -10:0.1:10;
mf = fismf("pimf", [-9 -7 2 7]);
y = evalmf(mf, x);
% plot membership function
plot(x, y, 'linewidth', 1.5), grid on, ylim([-0.2 1.2]);
xlabel('\it{x}'), ylabel('\mu(\it{x})')
% find the fuzzy value when the crisp value x = 4
fuz_value = evalmf(mf, 4)
xline(4, '--', '4');
yline(fuz_value, '--', sprintf('%.4f', fuz_value));
댓글 수: 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!