Académique Documents
Professionnel Documents
Culture Documents
\ .
>>
>>
>>
Exercise: Geometry
Find the volume of the oil tank below.
12
MATLAB Expression
20m
ANS
24m
Variables
Assign the results into variables.
13
x = 3^4 + 27^(1/3)
4
3
3 27 x = +
y = (2+3i)*(1-2i)
(2 3 )(1 2 ) y i i = +
z = sqrt( x^2 + y^2 ) ;
2 2
z x y = +
Do not print the answer!
Workspace Variables
Variables live in the MATLAB workspace.
14
>> x = 3^4 + 27^(1/3)
x =
84
>> y = (2+3i)*(1-2i);
>> z = sqrt( x^2 + y^2 );
>> who
Your variables are:
ans x y z
>> clear
>> who
>>
who
who a*
whos
clc
List variable names.
List variable names
beginning with a.
List variable in long
format.
Clear command window.
clear Clear variables from
memory.
help doc
what
Exercise: Geometry & Trigonometry
Find the distance between C
2
and C
4
.
15
1
C
2
C
3
C
4
C
1
2
3
4
16
6.5
12
9.5
R mm
R mm
R mm
R mm
=
a
b
c
u
2 2 2
2 cos c a b ab u = +
Hint: Use the following identity.
Exercise: Your Solution
Mathematical Expressions
MATLAB Expressions
Your Answer:
16
Key Takeaways
Now, you know how to
customize the MATLAB startup script.
use the MATLAB desktop windows.
change the layout of the desktop windows.
evaluate mathematical expressions.
17
Q & A
18