Introduction to MATLAB

In this book the name MATLAB® (short for Matrix Laboratory) will refer to:

  • the program launched by using the command matlab in Dos or Unix environments, or by clicking on its icon in a graphic environment such as x11, Windows, MacOS...,
  • or the language defined by a vocabulary and syntax rules.

MATLAB® is an interpreter, that is to say a program that remains in the computer’s memory once it is launched. MATLAB® displays a command window used for interpreting commands. If they are considered correct, MATLAB® will execute them. This execution will itself lead to verifications.

Example 1 (Direct interpretation) Type a=2*log10(5) then <return>. The result is shown in a PC environment (Figure 1).

Image

Figure 1The MATLAB® command window on MS-Windows

Commands can be gathered together in text files called matlab programs. The user gives them a name that can be called from the prompt line. The MATLAB® documentation explains how to use an editor to create such files. This editor may either be integrated in the software or kept external (the user’s favorite editor). Program files use the extension .m. If a program is called prog1.m, all the user has to do is type prog1 in the MATLAB® command window to have it executed. MATLAB® then searches for the file in the routine directory. If it doesn’t find the file there, it looks for prog1.m in the various files specified in ...

Get Digital Signal and Image Processing Using MATLAB now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.