Getting the error "Unable to resolve the name filename.m" while trying to run a script

41 visualizaciones (últimos 30 días)
I'm using MATLAB R2019b, and every file that I run a script (filename.m) in the command window it gives me the error: "Unable to resolve the name filename.m".
I already tried the following commands that I found on MATLAB Answers:
"restoredefaultpath
savepath"
but it still doesn't work.

Respuesta aceptada

MathWorks Support Team
MathWorks Support Team el 24 de Jun. de 2020
This error occurs when the script 'filename.m' is run at Command Prompt, as the dot is interpreted as an operator. So MATLAB searches for a struct with the name 'filename' and a field 'm', instead of 'filename' script file.
To fix this, you need to call the script without the extension (as follows):
>>filename

Más respuestas (0)

Categorías

Más información sobre Debugging and Analysis en Help Center y File Exchange.

Productos


Versión

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by