Page 17 - MATLAB an introduction with applications
P. 17
2 ——— MATLAB: An Introduction with Applications
differential equations, and system of equations was presented. Symbolic mathematics can also be used to
determine analytical expressions for the derivative and integral of an expression.
1.1.1 Starting and Quitting MATLAB
To start MATLAB click on the MATLAB icon or type in MATLAB, followed by pressing the enter or return
key at the system prompt. The screen will produce the MATLAB prompt >> (or EDU >>), which indicates that
MATLAB is waiting for a command to be entered.
In order to quit MATLAB, type quit or exit after the prompt, followed by pressing the enter or return key.
1.1.2 Display Windows
MATLAB has three display windows. They are
1. A Command Window which is used to enter commands and data to display plots and graphs.
2. A Graphics Window which is used to display plots and graphs.
3. An Edit Window which is used to create and modify M-files. M-files are files that contain a
program or script of MATLAB commands.
1.1.3 Entering Commands
Every command has to be followed by a carriage return <cr> (enter key) in order that the command can be
executed. MATLAB commands are case sensitive and lower case letters are used throughout.
To execute an M-file (such as Project_1.m), simply enter the name of the file without its extension (as in
Project_1).
1.1.4 MATLAB Expo
In order to see some of the MATLAB capabilities, enter the demo command. This will initiate the MATLAB
EXPO. MATLAB EXPO is a graphical demonstration environment that shows some of the different types of
operations which can be conducted with MATLAB.
1.1.5 Abort
In order to abort a command in MATLAB, hold down the control key and press c to generate a local abort with
MATLAB.
1.1.6 The Semicolon (;)
If a semicolon (;) is typed at the end of a command, the output of the command is not displayed.
1.1.7 Typing %
When per cent symbol (%) is typed in the beginning of a line, the line is designated as a comment. When the
enter key is pressed, the line is not executed.
1.1.8 The clc Command
Typing clc command and pressing enter cleans the command window. Once the clc command is executed, a
clear window is displayed.
1.1.9 Help
MATLAB has a host of built-in functions. For a complete list, refer to MATLAB user’s guide or refer to the
on-line Help. To obtain help on a particular topic in the list, e.g., inverse, type help inv.
F:\Final Book\Sanjay\IIIrd Printout\Dt. 10-03-09