- 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
60 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
kuna Venkateswararao
el 25 de Mayo de 2021
Comentada: Alexander Greilich
el 22 de Jun. de 2023
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 comentarios
Respuestas (1)
Shiva Kalyan Diwakaruni
el 28 de Mayo de 2021
Editada: Shiva Kalyan Diwakaruni
el 28 de Mayo de 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 comentario
Alexander Greilich
el 22 de Jun. de 2023
Thanks, your instructions helps temporary. But after a restart, i got the same error message again.
Ver también
Categorías
Más información sobre File Operations en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!