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!
