How to implement the linear output function in Takagi–Sugeno Fuzzy System?

2 visualizaciones (últimos 30 días)
m
m el 10 de Abr. de 2013
Respondida: Sam Chak el 27 de Sept. de 2024
hi, i want to implement Takagi Sugeno model in matlab using FIS, how can i set this rule:
"if x is large and y is small, then z=x+y+2"
of course i can add "If (x is large) and (y is small) then (Z is '...')", but i cannot add "x+y+2", how can i do it?
thanks so much

Respuestas (1)

Sam Chak
Sam Chak el 27 de Sept. de 2024
Hi @m
To describe the equation (a flat plane surface), use the syntax 'linear', [1 1 2] in the addMF() command for the output z.
%% Sugeno fuzzy system
fis = sugfis;
%% Fuzzy Inputs, x and y
fis = addInput(fis, [0+eps 1], 'Name', 'x');
fis = addMF(fis, 'x', 'linsmf', [0 1], 'Name', 'large'); % Large fuzzy set
fis = addInput(fis, [0+eps 1], 'Name', 'y');
fis = addMF(fis, 'y', 'linzmf', [0 1], 'Name', 'small'); % Small fuzzy set
%% Fuzzy Output, z = 1·x + 1·y + 2
fis = addOutput(fis, [2 4], 'Name', 'z');
fis = addMF(fis, 'z', 'linear', [1 1 2], 'Name', 'Eq1');
%% Rule: If (x is large) and (y is small), Then (Z is Eq1 = x + y + 2)
rule = "x==large & y==small => z=Eq1";
fis = addRule(fis, rule);
%% The surface
opt = gensurfOptions('NumGridPoints', 101);
gensurf(fis, opt), grid on, grid minor, zlim([2 4])

Categorías

Más información sobre Fuzzy Logic Toolbox 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!

Translated by