You are on page 1of 18

‫‪Lecture 3‬‬

‫وبرڪاتہ‬
‫ٗ‬ ‫السّالم و عليڪم ورحمة ہّللا‬
How to do simple arithmetic calculations the arithmetic
operations are:
addition (+)
subtraction (-)
multiplication (*)
division and (/)
exponentiation (^)
Here are some
examples:

Equivalent valid
MATLAB
statement
3
√ 5−1
–1
2
( √5+1)
Area = with
3
𝑒
𝑙𝑛 (𝑒 )
3
lo𝑔10 (𝑒 )
3
𝑙𝑜𝑔10 (10 )
5
Solve for x and
check the result.
• It can be solved by taking log
on both sides

• Or
Solve for x and
check the result.
• How to verify this
solution?
• Put this value in the
given equation if
equation is satisfied
then the solution is
correct.
Calculate
2 𝜋 2 𝜋
sin + cos
6 6
Matlab recognizes the letters i and j as the imaginary
number

The difference between complex numbers 2 + 5i or 2+5*i.

The former case is always interpreted as a complex number whereas


the letter case is taken as a complex number only if i has not been
assign any local value.

Same is true for j


Compute the following quantities:
𝜋
𝑖
6
𝑒

It is same as
Execute the command exp(pi/2i) and exp(pi/2*i). What is the
difference between both?
• Left for students

You might also like