Writing programs

In MATLAB you can write two kinds of programs. Since both kinds have the extension .m, they are called m-files. They have been briefly discussed in Chapter 1. One distinguishes the script m-file and the function m-file, whose difference has been discussed in Chapter 1. Unless stated otherwise, in the rest of this chapter script files are used.

In general, m-files are: ....... unless you have provided comments extensively (with a %-sign at the beginning of the line):
% these are comment line in an M-file
% and hence they are not executed as commands.

Previous      Next      Up      Contents

Esteur 2010-03-22