When I try to run plotActual​AndExpecte​dResultsWi​thRMSE function in matlab, it shows me 'unrecognized function or variable ' error.

Hello everyone,
I'm trouble with that command 'plotActualAndExpectedResultsWithRMSE'. That command gives me error as follows;
Unrecognized function or variable 'plotActualAndExpectedResultsWithRMSE'.
How can figure out this problem. Important for me and my thesis not progressing because of that problem. I thought it might be related to my matlab version but altought I try other versions result still same. I use R2020b and I tried 2021b-2019a-2019b. Please take a look.
The subject i am working on "Tune Mamdani Fuzzy Inference System". Link here;
How can I calculate while that error is still there the RMSE between the generated output data and the validation output data set.

Answers (1)

Hi,this is Local Functions in
maybe can help you to slove this problem~
function [rmse,actY] = calculateRMSE(fis,x,y)
% Specify options for FIS evaluation
evalOptions = evalfisOptions("EmptyOutputFuzzySetMessage","none", ...
"NoRuleFiredMessage","none","OutOfRangeInputValueMessage","none");
% Evaluate FIS
actY = evalfis(fis,x,evalOptions);
% Calculate RMSE
del = actY - y;
rmse = sqrt(mean(del.^2));
end
function plotActualAndExpectedResultsWithRMSE(fis,vldX,vldY)
[rmse,actY] = calculateRMSE(fis,vldX,vldY);
figure
plot([actY vldY])
axis([0 length(vldY) min(vldY)-0.01 max(vldY)+0.13])
xlabel('sample index')
ylabel('signal value')
title(['RMSE = ' num2str(rmse)])
legend(["Actual output" "Expected output"],'Location',"northeast")
end

Categories

Find more on Fuzzy Logic Toolbox in Help Center and File Exchange

Products

Release

R2020b

Asked:

on 1 Jun 2022

Commented:

on 16 May 2023

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!