Why am I getting the error "The specified superclass 'xyz' contains a parse error, cannot be found on MATLAB's search path, or is shadowed by another file with the same name."?
17 views (last 30 days)
I am receiving the following error:
The specified superclass 'xyz' contains a parse error, cannot be found
on MATLAB's search path, or is shadowed by another file with the same name.
This error message can occur in many scenarios, for example, during MATLAB startup, when calling a MATLAB script or function, when creating a standalone application with MATLAB Compiler, or when executing a standalone application against MATLAB Runtime.
Edited: MathWorks Support Team on 9 Aug 2022
If you encounter the error message in MATLAB, generally, this error is received when there is a user-defined function in the MATLAB search path which has the same name as the MATLAB built-in function. In order to resolve the issue follow the troubleshooting steps below:
a) Manually go through the MATLAB search path and remove the paths which have functions conflicting with built-in MATLAB functions. Execute the following command to get the list of the current search path.
The following command may help to find the source of the issue:
>> which -all <conflicting_function>
b) If you are unsure of which paths to remove or the above command displays only one line, restore the MATLAB search path to its factory-installed state by executing the following command :
Notice that the above command may remove the paths that you have previously added to the MATLAB search path in order for your scripts to work. So it is advisable to save a backup copy of the current MATLAB search path before running the command.
Refer to the following link to the documentation to back up the current search path: http://www.mathworks.com/help/matlab/ref/savepath.html
If you encounter the error message while executing a MATLAB standalone executable that was created using MATLAB Compiler, check if your system path points to the correct version of MATLAB Runtime (matching the MATLAB release and Update used for deployment), as explained in the following documentation: https://www.mathworks.com/help/compiler/mcr-path-settings-for-run-time-deployment.html