How to make an infinite interval for an input variable in fuzzy logic

2 Ansichten (letzte 30 Tage)
Yuri Khudyakov
Yuri Khudyakov am 2 Mai 2021
Beantwortet: Sam Chak am 15 Apr. 2025
Hello! Can the input variable have infinite intervals to keep from going out of bounds? I understand that we can truncate data if it goes out of range before transferring it to a variable, but I would like not to do crutches.

Antworten (1)

Sam Chak
Sam Chak am 15 Apr. 2025
While it is impossible to have an infinite interval when designing the universe of discourse for a fuzzy variable (since infinity cannot be quantified in a strict numerical sense), it is possible to define the interval using the largest finite floating-point number in IEEE double precision. This number is referred to as realmax in MATLAB and is equal to:
.
With a number this large, it should be sufficient to simulate almost any physical laws and behaviors in the observable universe.
fis = sugfis;
% Fuzzy Input
fis = addInput(fis, [-realmax, realmax], 'Name', 'x');
fis = addMF(fis, 'x', 'linzmf', [-realmax/2, realmax/2], 'Name', 'Neg_BigBigBig');
fis = addMF(fis, 'x', 'linsmf', [-realmax/2, realmax/2], 'Name', 'Pos_BigBigBig');
% Fuzzy Output
fis = addOutput(fis, [-1, 1], 'Name', 'y');
fis = addMF(fis, 'y', 'constant', -realmax/2, 'Name', 'Neg_BigBigBig');
fis = addMF(fis, 'y', 'constant', realmax/2, 'Name', 'Pos_BigBigBig');
% Fuzzy Rules
rules = [
"x==Neg_BigBigBig => y=Neg_BigBigBig"
"x==Pos_BigBigBig => y=Pos_BigBigBig"
];
fis = addRule(fis, rules);
figure
plotmf(fis, 'input', 1, 1e5), grid on, grid minor
title('Input fuzzy sets')
figure
opt = gensurfOptions('NumGridPoints', 101);
gensurf(fis, opt), grid on, grid minor, ylim([-realmax, realmax])
title('Output')

Kategorien

Mehr zu Fuzzy Logic in Simulink finden Sie in Help Center und File Exchange

Produkte


Version

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by