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

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.

 Accepted Answer

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

More Answers (0)

Categories

Find more on Environment and Settings in Help Center and File Exchange

Products

Release

R2019b

Community Treasure Hunt

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

Start Hunting!