Practical 5: Function and Script M-files
Script M-file
We discussed M-files as early as in Practical 2.
Generally speaking, script M-file is a list of commands (programming code) saved in one document.
Some advantages:
- Easy to use: you can run all the commands in your file by hitting one key.
- No need to re-type or re-run lengthy code.
Disadvantages:
- Values from the script M-file can’t be easily assigned to variables in the Command Window. You must open, edit and save the M-file to edit values.