How to get an output value for a Mamdani fuzzy system using evalfis() command
2 次查看(过去 30 天)
显示 更早的评论
How I can get the output value for mamdani fuzzy system using this command evalfis([1 2],fis).
FIS Evaluation: To evaluate the output of a fuzzy system for a given input combination, use the evalfis command. For example, evaluate a using input variable values of 1 and 2. evalfis([1 2],fis) ans = 5.5586 You can also evaluate multiple inputs.
0 个评论
回答(1 个)
Sam Chak
2025-4-27
It is likely simpler than you have anticipated if you design the Mamdani system correctly according to mathematical reasoning procedure.
%% Design a Mamdani fuzzy system called "fis"
fis = mamfis;
% Fuzzy Input 1
fis = addInput(fis, [0 2], 'Name', 'in1');
fis = addMF(fis, 'in1', 'trimf', [0 1 2], 'Name', 'All-Encompassing');
% Fuzzy Input 2
fis = addInput(fis, [1 3], 'Name', 'in2');
fis = addMF(fis, 'in2', 'trimf', [1 2 3], 'Name', 'All-Encompassing');
% Fuzzy Output 1
fis = addOutput(fis, [3 8], 'Name', 'out');
val = 5.5586; % desired value
fis = addMF(fis, 'out', 'trimf', [val-2 val val+2], 'Name', 'myValue');
% Fuzzy Rule
fis = addRule(fis, "If in1 is All-Encompassing and in2 is All-Encompassing then out is myValue");
%% Testing evalfis output
input1 = 1;
input2 = 2;
output = evalfis(fis, [input1, input2])
plotrule(fis, Inputs=[1, 2])
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!
