- 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
63 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
Shiva Kalyan Diwakaruni
2021-5-28
编辑:Shiva Kalyan Diwakaruni
2021-5-28
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 个评论
Alexander Greilich
2023-6-22
Thanks, your instructions helps temporary. But after a restart, i got the same error message again.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 File Operations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!