How to implement the linear output function in Takagi–Sugeno Fuzzy System?
2 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
Sam Chak
2024-9-27
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])
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Fuzzy Logic Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!