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 CenterFile Exchange에서 Fuzzy Logic Toolbox에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by