When I try to run plotActualAndExpectedResultsWithRMSE function in matlab, it shows me 'unrecognized function or variable ' error.
Show older comments
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;
". 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)
Boris CHEN
on 16 May 2023
Moved: Cris LaPierre
on 16 May 2023
0 votes
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
1 Comment
Cris LaPierre
on 16 May 2023

See an explanation here: https://www.mathworks.com/help/matlab/matlab_prog/create-functions-in-files.html
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!