m files cannot run
299 views (last 30 days)
hello i have matlab 7.9 R2009b and i cannot run my m files that i create i have not completely understood in which file they must be located so that i can run them i have tried the MATLAB file that the programm created in my documents file i have also tried the matlab/bin file (i have ubuntu and matlab is installed in my home directory, unfortunately) but none of these worked :( when i try to run the m file, a window appears that is saying "file is not found in the current directory or in the matlab path. to run this file u can either change the matlab current directory or or add its directory to the matlab path" and then then u can choose either "change directory" or "add to path" but none of these work, too please, i would really appreciate it if anyone could helo
Walter Roberson on 23 Jan 2014
Make sure the filenames end in .m and there is no hidden extension. Make sure the files are readable by you. Put the files in a convenient directory that does not have MATLAB installed in it. Start up MATLAB. Use pathtool to add that directory to the MATLAB path. You should now be able to invoke the code by giving the base file name without the directory and without the extension.
If it is not able to find it, then try using "which" to see what it says. For example if the file is MyProgram.m then
which -all MyProgram