MATLAB error when starting program "try.m"

After creating a MATLAB file (version 2010a) in the editor, I get the following error:

"MATLAB cannot run this file because \ toolbox \ matlab \ lang \ try.m is hiding it in the MATLAB path."

In addition, I get the option to "change folder", "add path". Even after clicking and working with this option, I get the same message.

I looked in the Matlab manual and tried to change the path. Also I checked my path variable, the place where I store my matlab files already exists in the path variable. Please help fix the error. My file name is try.m. The code inside `try.m 'is correct:

 clear all;

      

+3


source to share


2 answers


TRY is a reserved word in MATLAB, so you shouldn't use it for your filename. Rename "try.m" to something else and you should be fine. You can do this by using "Save As" in the "Editor" menu and typing a different name.



+8


source


Is your file also named in the file editor lang.m

? As Matlab sometimes cannot resolve differences in differences between m files in the current directory and m files, which are built-in functions. You don't seem to be saying that your file is not in the path; rather, it looks like it cannot tell your file from \toolbox\matlab\lang

.



Can you provide more details on what your file is, such as submitting the code and including the name of the working directory?

0


source







All Articles