Error in EVALFIS_ Fuzzy Logic Toolbox
조회 수: 2 (최근 30일)
이전 댓글 표시
Dear Coder,
Upon perform fuzzy inference calculations, MATLAB throw the following error
Error using evalfismex
Illegal parameters in fisGeneralizedBellMf() --> a = 0
May someone shed some light about this particular warning/error.
The mock mock data and code are as below.
Thanks in advances
load('help_FL.mat');
RADIUS = 0.01;
C1 = cat(1,LabelTest,LabelTrain);
C2 = cat(1,FeatureTest,FeatureTrain);
% Fc=FeatureTrain;FeatureTest;
AllData=[C2,C1];
TrainData=[FeatureTrain,LabelTrain];
TestData=[FeatureTest,LabelTest];
cccc=[min(AllData); max(AllData)];
% GENFIS2 Generates a Sugeno-type FIS using subtractive clustering.
% fis = genfis2(FeatureTrain, LabelTrain, RADIUS, [min(AllData); max(AllData)]);
fis = genfis(FeatureTrain, LabelTrain);
% ANFIS Adaptive Neuro-Fuzzy training of Sugeno-type FIS.
[trainFis, trainError, stepSize, checkFis, checkError] = ...
anfis(TrainData, fis, 3, [], TestData);
% Perform fuzzy inference calculations
trainFisOut = round(evalfis(double(FeatureTest), trainFis));
trainRMSE = norm(trainFisOut - LabelTest) / sqrt(length(trainFisOut));
badTrainFis = size(find((trainFisOut == LabelTest) == 0), 1);
% Perform fuzzy inference calculations
checkFisOut = round(evalfis(FeatureTest, checkFis));
checkRMSE = norm(checkFisOut - LabelTest) / sqrt(length(checkFisOut));
badCheckFis = size(find((checkFisOut == LabelTest) == 0), 1);
fprintf('Training: %d (%.2f%%)\n', ...
badTrainFis, badTrainFis / size(TestData, 1) * 100);
fprintf('Valid: %d (%.2f%%)\n', ...
badCheckFis, badCheckFis / size(TestData, 1) * 100);
댓글 수: 0
답변 (0개)
참고 항목
카테고리
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!