why i do Unrecognize variable addInput?

조회 수: 1 (최근 30일)
carolus aditya
carolus aditya 2023년 1월 19일
편집: Abhinav 2023년 1월 19일
I had a problem in running mscript fuzzy in matlab 2022 (Unrecognize variable addInput). How can i fix that?
There is a script
fis1 = 'sugfis';
% Define input variables and ranges
fis1 = addInput(fis1,[-1 1],'Name','E');
fis1 = addInput(fis1, [-1 1],'Name','delE');
% Define mf’s of input variable
fis1 = addMF(fis1,'E','trimf',[-1 -1 0],'Name','N');
fis1 = addMF(fis1,'E','trimf',[-1 0 1],'Name','Z');
fis1 = addMF(fis1,'E','trimf',[0 1 1],'Name','P');
fis1 = addMF(fis1,'delE','trimf',[-1 -1 0],'Name','N');
fis1 = addMF(fis1,'delE','trimf',[-1 0 1],'Name','Z');
fis1 = addMF(fis1,'delE','trimf',[0 1 1],'Name','P');
% Define output variables and ranges
fis1 = addOutput(fis1,[-1 1],'Name','U');
% Define mf’s of output variable
fis1 = addMF(fis1,'U','constant',[-1],'Name','NL');
fis1 = addMF(fis1,'U','constant',[-0.8],'Name','NS');
fis1 = addMF(fis1,'U','constant',[0],'Name','Z');
fis1 = addMF(fis1,'U','constant',[0.8],'Name','PS');
fis1 = addMF(fis1,'U','constant',[1],'Name','PB');
rules = [...
"E==N & delE==N => U=NL"; ...
"E==Z & delE==N => U=NS"; ...
"E==P & delE==N => U=Z"; ...
"E==N & delE==Z => U=NS"; ...
"E==Z & delE==Z => U=Z"; ...
"E==P & delE==Z => U=PS"; ...
"E==N & delE==P => U=Z"; ...
"E==Z & delE==P => U=PS"; ...
"E==P & delE==P => U=PB"; ...
];
% Add rule table
fis1 = addRule(fis1,rules);
There is a problem
Error in TIPE1 (line 3)
fis1 = addInput(fis1,[-1 1],'Name','E');
Thanks Before
Regards,
Carolus

답변 (1개)

Abhinav
Abhinav 2023년 1월 19일
편집: Abhinav 2023년 1월 19일
Hi carolus
fis1 = 'sugfis';
This is likely the cause of the error, remove the quotes from sugfis

카테고리

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