Chapter 1 Introduction
Chapter 1 Introduction
Chapter 1 Introduction
Structured Computer
Programming
King Abdulaziz University
Faculty of Engineering
Electrical and Computer Engineering
Department
C1-1 2022 1
MATLAB
C1-1 2022 3
The Desktop of MATLAB
C1-1 2022 4
The default MATLAB
Desktop
C1-1 2022 5
The screen of MATLAB consist of four
windows. These are the :
-command window
-command history window
-current directory
-workspace
C1-1 2022 6
Command window
-used to type instructions of various
types called commands, functions and
statements.
-MATLAB displays the prompt >> to
indicate that it is ready to receive
instructions .
C1-1 2022 7
Command history window
-This window shows all the previous
keystrokes you entered in the
command window
-It is useful for keeping track of what you
typed
C1-1 2022 8
Current Directory window
-use it to access files
-Double clicking on a file name with the
extension .m will open that file in the
MATLAB editor
C1-1 2022 9
Workspace window:
-displays the variables created in the
command window
C1-1 2022 10
An Example interactive
(Calculator) Session
C1-1 2022 11
Entering Commands and
Expressions
MATLAB retains your previous keystrokes.
Use the up-arrow ↑ key to scroll back & back
through the commands. Press the ↑ key once to
see the previous entry, and so on.
Use the down-arrow ↓ key to scroll forward.
Edit a line using the left ← - and right → -arrow
keys the Backspace key, and the Delete key.
Press the Enter ↵ key to execute the command.
You can see the previous keystrokes displayed
in the Command History window. Execute by
double click.
You can copy (highlighting & ctrl+c) a line from
Command history window, to Command window.
C1-1 2022 12
The MATLAB Help System
To explore the more advanced features of MATLAB not covered in this course, you
will need to know how to use effectively the MATLAB.
The MATLAB has Help System to get help for using Math Works products.
MATLAB Help System consists of :
1-Help Browser
2-Help Functions
3-Other Resources
C1-1 2022 13
Help Browser
C1-1 2022 14
Help Functions
lookfor topic: Displays in the Command window a brief description for all
functions whose description includes the specified key word topic.
doc funcname: Opens the Help Browser to the reference page for the
specified function funcname, providing a description, additional remarks,
and examples.
C1-1 2022 15
C1-1 2022 16
C1-1 2022 17
Other Resources
Search documentation for other
MathWorks products .
Books.
Internet
C1-1 2022 18