Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MATLAB error when running the program "try.m"

Tags:

matlab

After creating a MATLAB (version 2010a) file in the editor, I am getting the below mentioned error:

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

Also with this I get an option to "change folder", "add the path". Even after clicking and working around with this option I keep getting the same message.

I looked up in the matlab manual and tried to change the path. Also I checked my path variable, the place where I am storing my matlab files is already there in the path variable. Please help correcting the error. The name of my file is try.m The code inside 'try.m' is just:

 clear all;
like image 313
Jannat Arora Avatar asked May 15 '26 00:05

Jannat Arora


1 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 using the "Save As" from the Editor menu and typing a different name.

like image 149
Matthew Simoneau Avatar answered May 18 '26 08:05

Matthew Simoneau



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!