Executing Matlab Script (.m) Files



To execute the commands in a .m file, or to load/use a function defined in an .m file, just type the name of the .m file (but leave off the .m extension).

Alternately, one can execute the commands in a script file by selecting the File/Run Script menu item in the GUI, and then choosing the .m file with the Run Script selection dialog.

Matlab looks in your current directory for the .m file first, and then searchers the other directories as specified by the path variable.

See Also : Directory Commands

UCLA Mathematics Department ©2000