Why does using the "anfis" function result in invalid values for the membership function?
显示 更早的评论
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?
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Fuzzy Logic Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!