How to make an infinite interval for an input variable in fuzzy logic
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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.
0 comentarios
Respuestas (1)
Sam Chak
el 15 de Abr. de 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')
0 comentarios
Ver también
Categorías
Más información sobre Fuzzy Logic in Simulink en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

