![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1779890/image.png)
How to implement the linear output function in Takagi–Sugeno Fuzzy System?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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
0 Kommentare
Antworten (1)
Sam Chak
am 27 Sep. 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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1779890/image.png)
%% 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])
0 Kommentare
Siehe auch
Kategorien
Mehr zu Fuzzy Logic Toolbox finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!