Question
I am using the standard Matlab function canoncorr.m to calculate canonical correlations between two large data sets. However, I get error messages on lines 145 and 149. This error also appears with basic random 3x9 matrices for both x and y. line 145: stats.pF = fpval(stats.F, stats.df1, stats.df2); line 149: stats.pChisq = chi2pval(stats.chisq, stats.df1); they both throw an error of "function not defined for argument of type double" then if I search for them or try to find help files I get "function not found" errors. I fear the files were overwritten but I cannot even seem to find them on other computers with matlab in order to replace them on my machine. Perhaps parts of my path were inadvertently deleted? Does anyone know the location of these built in files? Any help would be greatly appreciated.
Expert Answer
Neeta Dsouza
PhD Expert
Answered Aug 24, 2026
They may have been overshadowed with other functions or variables with the same names, but you likely didn’t delete them.
In the Command Window, type:
which fpval -all which chi2pval -all
I get as the result:
C:\Program Files\MATLAB\R2014a\toolbox\stats\stats\private\fpval.m % Private to stats C:\Program Files\MATLAB\R2014a\toolbox\stats\stats\private\chi2pval.m % Private to stats
If you get more than that (for the MATLAB version you have), you need to track down the shadowing variables or functions and rename them. It’s probably best to do this just after you get the error, with any potentially problematic functions or variables still in your workspace so you can detect them
100% Run Guarantee
3-Hour Fast-Track Delivery
Need a Custom Version or Complete Simulation for This Problem?
Our 500+ PhD engineers build, debug, and optimize working MATLAB scripts and Simulink (.slx) models tailored to your exact assignment rubrics with zero plagiarism.
Tested on MATLAB R2024b / R2026a
Turnitin 0% Plagiarism Report
Free 7-Day Revisions Guarantee
Have a different question? Ask here
Related Statistics and Machine Learning Toolbox Questions & Solutions
Browse All →
Explore similar technical troubleshooting questions and verified MATLAB solutions:
Ready-to-Run MATLAB & Simulink Projects
Browse All Projects →