next About this document ...
up Music 270a: Matlab Tutorial 1
previous Vector Operations


Scripting and creating M-files

It won't be long before your programs are too long and you get tired of entering everything on the command line. Fire up your favourite text editor (or use the built-in Matlab editor) and write a sequence of Matlab commands (remember to use ``;'' at the end of each line to suppress the output). Save the file with whatever name you wish $ <$mfilename$ >$ , but make sure to include a ``.m'' extension, that is, $ <$mfilename.m$ >$ . You can call your script from the command prompt with the name of the file (without the .m extension).

>> mfilename


next About this document ...
up Music 270a: Matlab Tutorial 1
previous Vector Operations

``Music 270a: Digital Audio Processing'' by Tamara Smyth, Department of Music, University of California, San Diego (UCSD).
Download PDF version (matlabtut1.pdf)
Download compressed PostScript version (matlabtut1.ps.gz)

Copyright © 2013-01-07 by Tamara Smyth.
Please email errata, comments, and suggestions to Tamara Smyth<trsmyth@ucsd.edu>