Why does using the "anfis" function result in invalid values for the membership function?
Show older comments
I am using the "anfis" function from the Fuzzy Logic Toolbox in MATLAB R2022b and get the following error message when I try to train a Fuzzy Inference System with a Membership Function of type "trapmf" or "trimf":
Error using fuzzy.internal.utility/validateTriMFParameterValuesFirst parameter must be less than or equal to second parameter.
Shown below is the code I used to train a Fuzzy Inference System with a Membership Function of type "trimf":
% Load data
inputData = tr_data(:,[1:4]);
outputData = tr_data(:,5);
% Trimf ANFIS option config
opt_tri = genfisOptions('GridPartition');
opt_tri.OutputMembershipFunctionType = 'linear';
opt_tri.NumMembershipFunctions = 3;
opt_tri.InputMembershipFunctionType = "trimf";
triAnfis = genfis(inputData,outputData,opt_tri);
triAnfis.andMethod = 'prod';
triOpt = anfisOptions('InitialFis', triAnfis);
triOpt.EpochNumber = 10;
triOpt.InitialStepSize=0.01;
triOpt.OptimizationMethod=1; % hybrid optimization method
triOpt.ValidationData = ck_data; % set checking data
[triFis,triTrErr,~,triChkFis,triCkErr] = anfis(tr_data,triOpt);
I tried using the "Neuro-Fuzzy Designer" app as well but got the same error message. Why is the "anfis" function setting values for the Membership Function parameters to invalid values?
Accepted Answer
More Answers (0)
Categories
Find more on Fuzzy Logic Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!