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.
0 个评论
回答(1 个)
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
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 Exchange 中查找有关 Fuzzy Logic Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!