- Debug the code with "dbstopiferror" and locate the line.
- Execute "rehash toolboxcache" and "restoredefaultpath" and check if it still results in error.
- Try creating a new custom system object by inheriting "rl.env.MATLABEnvironment'" and check if calling this also results in the same error.
- Try p-coding your custom class and check if this results in the same error.
- Try executing the command "clear classes" and check if the error goes away.
- If none of the above steps work, reinstall the MATLAB as this issue may have been related to corrupted class hierarchies in MATLAB.
The specified superclass rl.env.MATLABEnvironment' contains a parse error , cannot be found on MATLAB search path , or is shadowed by another file with same name
58 views (last 30 days)
Show older comments
Hi,
I am defining custom RL environment as
classdef SmallCellEnv < rl.env.MATLABEnvironment
but it gives error when I run it in MATLAB offline 'The specified superclass rl.env.MATLABEnvironment' contains a parse error , cannot be found on MATLAB search path , or is shadowed by another file with same name, How to resolve this error.
0 Comments
Answers (1)
Shiva Kalyan Diwakaruni
on 28 May 2021
Edited: Shiva Kalyan Diwakaruni
on 28 May 2021
Hi,
Generally the error "cannot be found on MATLAB's search path, or is shadowed by another file with the same name." 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) Please, manually go through the MATLAB search path and remove the paths which have functions conflicting with in build MATLAB functions. Execute the following command to get the list of the current search path.
>> 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, please restore the MATLAB search path to its factory-installed state by executing the following command :
>> restoredefaultpath
Please, notice that the above command may remove the paths that you have previously added to 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.
Please, refer to the following link to the documentation to backup the current search path:
if the above error still persists please try the below steps
Hope it helps
1 Comment
Alexander Greilich
on 22 Jun 2023
Thanks, your instructions helps temporary. But after a restart, i got the same error message again.
See Also
Categories
Find more on File Operations 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!