Chapter 1 Introduction

Download as pdf or txt
Download as pdf or txt
You are on page 1of 17

EE 201

Structured Computer
Programming
King Abdulaziz University
Faculty of Engineering
Electrical and Computer Engineering
Department
C1-1 2022 1
MATLAB

 The name of MATLAB stands for


matrix laboratory.
 Starting a MATLAB Session
-On Microsoft® Windows® platforms,
start the MATLAB program by double-
clicking the MATLAB R2020a shortcut
on your Windows desktop.
-Or from Start –All programs-Matlab

C1-1 2022 3
The Desktop of MATLAB

 When you start MATLAB, the desktop


appears, containing tools (graphical
user interfaces) for managing files,
variables, and applications associated
with 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

Note: MATLAB uses high precision for its


computations. But by default it usually displays its
results using four decimal places( short format )

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

 The Help Browser enables you to search and


view documentation for MATLAB and other
Math Works products.

 Help menu→ Product Help or click the question


mark button in the toolbar

C1-1 2022 14
Help Functions

 help funcname: Displays in the Command window a description of the


specified function funcname.

 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

You might also like