How to get the fuzzy value of an input when the crisp value is given
18 views (last 30 days)
Show older comments
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 Comments
Answers (1)
Sam Chak
on 18 Sep 2022
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 Comments
See Also
Categories
Find more on Fuzzy Logic Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!