In the rule viewer in the Fuzzy toolbox, how to to insert many inputs at one time and get the output automatically in the text format?

3 ビュー (過去 30 日間)
I have a question regarding the Fuzzy tool in the Mathlab. In the rule viewer, is there any way to insert many inputs at one time and get the output automatically in the text format or excel format?
For the time being, I have to insert the inputs one at a time to get the calculated output. This is time consuming because I have many inputs to be processed.
Thank you.

回答 (1 件)

Iman Ansari
Iman Ansari 2013 年 4 月 30 日
Hi. You can use evalfis :
a = newfis('fis1.fis'); %create a new FIS file
a = addvar(a, 'input', 'x', [2 9]);%add and input variable 'x' into the FIS
a = addmf(a, 'input', 1, 'A1', 'trimf', [2 5 8]);%add 2 MFs into the variable x
a = addmf(a, 'input', 1, 'A2', 'trimf', [3 6 9]);
a = addvar(a, 'input', 'y', [4 11]);%add and input variable 'y' into the FIS
a = addmf(a, 'input', 2, 'B1', 'trimf', [5 8 11]);%add 2 MFs into the variable y
a = addmf(a, 'input', 2, 'B2', 'trimf', [4 7 10]);
a = addvar(a, 'output', 'z', [1 9]);%add and output variable 'z' into the FIS
a = addmf(a, 'output', 1, 'C1', 'trimf', [1 4 7]);%add 2 MFs into the variable z
a = addmf(a, 'output', 1, 'C2', 'trimf', [3 6 9]);
rulelist = [1 1 1 1 1;
-1 2 2 1 1;]; %2 rule is defined and added into FIS
a = addrule(a, rulelist);
writefis(a, 'fis1.fis');
ruleview fis1
b=readfis('fis1');
% outputs
out1=evalfis([5 8; 6 9; 8 10;3 5;5.5 7.7],b)
  1 件のコメント
Sanchit Saran Agarwal
Sanchit Saran Agarwal 2021 年 5 月 25 日
編集済み: Sanchit Saran Agarwal 2021 年 5 月 25 日
Sir, this program is not running in MATLAB. The error says, matlab:matlab.internal.language.introspective.errorDocCallback()

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeFuzzy Logic Toolbox についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by