Professional Documents
Culture Documents
MATLAB BASICS
OBJECTIVES :
At the end of the lesson, students should be able to:
1
3/4/2022
BASIC IDEAS
2
3/4/2022
Current Directory
• Shows the active directory.
Command Window
• This is where the variables, and MATLAB commands are entered
3
3/4/2022
Workspace
• Creates, imports, displays the name, value, min, and max size of the variables.
4
3/4/2022
10
5
3/4/2022
11
12
6
3/4/2022
13
14
7
3/4/2022
15
BASIC COMMANDS
16
8
3/4/2022
17
18
9
3/4/2022
– Press the up arrow key 5 times, then press the down arrow key twice, then
press enter:
• After the 5 times using the arrow key, it shows the x variable
• Then the down arrow key sequence moves down to show the x+y variable
19
– Click anywhere inside the “Command Window” and right click next to “>>”
– Press “Paste button”, the command is now entered into the command window,
now press enter button on the keyboard.
20
10
3/4/2022
21
22
11
3/4/2022
23
24
12
3/4/2022
Example 1.1
Albert Einstein
E=mc2
25
26
13
3/4/2022
Speed of light
-c=3.0*108 meters/second
Output
Mass (m) in kilograms
27
Developing an Algorithm-Hand
Example
28
14
3/4/2022
Developing an Algorithm-Hand
Example
29
30
15
3/4/2022
31
32
16