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, etc.
– 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 several subwindows (Figure 1) one of which is a command window used to type commands (instructions, functions names, program names), which are then directly “interpreted”.

Figure 1The MATLAB® command window on MS-Windows

images

MATLAB® can be used in two ways: by direct execution of the commands typed in the command window or by the execution of programs. When working on large-sized projects, we use several programs and/or functions, which should be organized by location on the disc. Examples of these three situations are as follows:

1. Direct execution by typing demands directly in the command window: as an example type x=log(2) at the MATLAB® prompt in the command window. The answer is shown in Figure 2.

Figure 2The result log(2) is given by the interpreter

images
Executed commands can be recalled by pressing the ↑ arrow to scroll through ...

Get Digital Signal and Image Processing using MATLAB, Volume 1: Fundamentals, 2nd Edition 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.