Error: "MATLAB cannot run this file because c:\~~~ shadows it. delete shadowing file and try again"
Afficher commentaires plus anciens
Hi I've a question about matlab simulink when I run a code, there are message
"MATLAB cannot run this file because c:\~~~ shadows it. delete shadowing file and try again"
what's the problem? And why this happen??
6 commentaires
Noah Vawter
le 13 Juin 2017
Hi, I found this happened when I had a .m and .slx file with the same base name. When I renamed the .m file, I could run it again.
bad: my_model.m, my_model.slx good: my_model_parameters.m, my_model.slx
biber alex
le 8 Fév 2018
you are right.thanks.
Sarvocch Gupta
le 26 Avr 2020
Thanks, it solved my problem!
Giulia Panico
le 8 Jan 2021
I had the same problem. Thanks!
Alexander Wallberg
le 2 Mar 2021
Same problem here! Thanks!
kunhui
le 7 Fév 2025
Well,I found it!Thanks!
Réponse acceptée
Plus de réponses (3)
Godspower
le 24 Sep 2023
3 votes
Rename the file name. that is, don't use the same mfile name with the slx file
1 commentaire
Manikandan
le 30 Mar 2024
Thank you for the solution.
I have renamed the files. But each time when i open simulink the links for constants are broken. So i have to go to mscript to run the code and save the parameters in workspace and then come back to simulink to run the sumulation. then it works fine.
Is this the same everytime? Appreciate your reply.
Dan Po
le 18 Oct 2016
0 votes
doesnt help me,the file name is not found.
4 commentaires
Walter Roberson
le 18 Oct 2016
Please post a copy of the error message, showing which file it says is doing the shadowing.
sridevi engg.college
le 7 Mar 2017
it shows basename not found
Walter Roberson
le 8 Mar 2017
sridevi engg.college, please post a complete copy of the error message.
basename is not the name of any routine used in MATLAB with any of the toolboxes I have. It is, however, the name of an OS-X and Linux executable that by standards convention should be at /usr/bin/basename . If you see a message about basename not being found, it is likely coming from outside MATLAB, such as a problem in starting up MATLAB itself due to the PATH environment variable being incorrect.
It is possible, though, that you could be executing MATLAB code that uses unix() or system() to try to invoke some shell commands that include basename and that is not being found, either due to PATH corruption or due to you being on MS Windows.
Walter Roberson
le 13 Nov 2024
which basename -all
he did not mean basename literally; he meant that you were to fill in the basic name of what you were searching for. For example,
which myfunction -all
which might potentially return back listings for myfunction.m and myfunction.mexw64
Hello ,
I faced same problem ,but what I did to resolve is ! keep file name for the code(Script) and model different.
Catégories
En savoir plus sur Scope Variables and Generate Names dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!