[go: up one dir, main page]

0% found this document useful (0 votes)
23 views31 pages

Matlab: Dr. Muhammad Yousuf Tufail

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 31

Matlab

Dr. Muhammad Yousuf Tufail

Department of Mathematics
NED University of Engineering & Technology.
‡ Yousuf Tufail ¯ Yousuf Tufail
tufail@neduet.edu.pk

Lecture 1

Dr. Muhammad Yousuf Tufail (NEDUET) Matlab Lecture 1 1/5


Creating Variable

Dr. Muhammad Yousuf Tufail (NEDUET) Matlab Lecture 1 2/5


Creating Variable
Profit per year=50000;

Dr. Muhammad Yousuf Tufail (NEDUET) Matlab Lecture 1 2/5


Creating Variable
Profit per year=50000;

Returning variable/ Recalling variable/Displaying variable

Dr. Muhammad Yousuf Tufail (NEDUET) Matlab Lecture 1 2/5


Creating Variable
Profit per year=50000;

Returning variable/ Recalling variable/Displaying variable

Profit per year

Dr. Muhammad Yousuf Tufail (NEDUET) Matlab Lecture 1 2/5


Creating Variable
Profit per year=50000;

Returning variable/ Recalling variable/Displaying variable

Profit per year


50000

Dr. Muhammad Yousuf Tufail (NEDUET) Matlab Lecture 1 2/5


Creating Variable
Profit per year=50000;

Returning variable/ Recalling variable/Displaying variable

Profit per year


50000
Example (1)

Dr. Muhammad Yousuf Tufail (NEDUET) Matlab Lecture 1 2/5


Creating Variable
Profit per year=50000;

Returning variable/ Recalling variable/Displaying variable

Profit per year


50000
Example (1)
What would be the profit after 8 year.

Dr. Muhammad Yousuf Tufail (NEDUET) Matlab Lecture 1 2/5


Creating Variable
Profit per year=50000;

Returning variable/ Recalling variable/Displaying variable

Profit per year


50000
Example (1)
What would be the profit after 8 year.

Solution

Dr. Muhammad Yousuf Tufail (NEDUET) Matlab Lecture 1 2/5


Creating Variable
Profit per year=50000;

Returning variable/ Recalling variable/Displaying variable

Profit per year


50000
Example (1)
What would be the profit after 8 year.

Solution
Req profit after 8 years= 8*Profit per year;

Dr. Muhammad Yousuf Tufail (NEDUET) Matlab Lecture 1 2/5


Creating Variable
Profit per year=50000;

Returning variable/ Recalling variable/Displaying variable

Profit per year


50000
Example (1)
What would be the profit after 8 year.

Solution
Req profit after 8 years= 8*Profit per year;
Req profit after 8 year

Dr. Muhammad Yousuf Tufail (NEDUET) Matlab Lecture 1 2/5


Creating Variable
Profit per year=50000;

Returning variable/ Recalling variable/Displaying variable

Profit per year


50000
Example (1)
What would be the profit after 8 year.

Solution
Req profit after 8 years= 8*Profit per year;
Req profit after 8 year
400000
Dr. Muhammad Yousuf Tufail (NEDUET) Matlab Lecture 1 2/5
Example (2)

Dr. Muhammad Yousuf Tufail (NEDUET) Matlab Lecture 1 3/5


Example (2)
What would be the profit after 12 years?

Dr. Muhammad Yousuf Tufail (NEDUET) Matlab Lecture 1 3/5


Example (2)
What would be the profit after 12 years?

Solution

Dr. Muhammad Yousuf Tufail (NEDUET) Matlab Lecture 1 3/5


Example (2)
What would be the profit after 12 years?

Solution
600000

Dr. Muhammad Yousuf Tufail (NEDUET) Matlab Lecture 1 3/5


Calculation of Body mass index(BMI)

Dr. Muhammad Yousuf Tufail (NEDUET) Matlab Lecture 1 4/5


Calculation of Body mass index(BMI)

weight
BMI = height 2

Dr. Muhammad Yousuf Tufail (NEDUET) Matlab Lecture 1 4/5


Calculation of Body mass index(BMI)

weight
BMI = height 2

Example (3)

Dr. Muhammad Yousuf Tufail (NEDUET) Matlab Lecture 1 4/5


Calculation of Body mass index(BMI)

weight
BMI = height 2

Example (3)
Calculate the body mass index for the following observation .
height = 1.79, weight = 68.7

Dr. Muhammad Yousuf Tufail (NEDUET) Matlab Lecture 1 4/5


Calculation of Body mass index(BMI)

weight
BMI = height 2

Example (3)
Calculate the body mass index for the following observation .
height = 1.79, weight = 68.7

Solution

Dr. Muhammad Yousuf Tufail (NEDUET) Matlab Lecture 1 4/5


Calculation of Body mass index(BMI)

weight
BMI = height 2

Example (3)
Calculate the body mass index for the following observation .
height = 1.79, weight = 68.7

Solution
height=1.79;

Dr. Muhammad Yousuf Tufail (NEDUET) Matlab Lecture 1 4/5


Calculation of Body mass index(BMI)

weight
BMI = height 2

Example (3)
Calculate the body mass index for the following observation .
height = 1.79, weight = 68.7

Solution
height=1.79;
weight=68.7;

Dr. Muhammad Yousuf Tufail (NEDUET) Matlab Lecture 1 4/5


Calculation of Body mass index(BMI)

weight
BMI = height 2

Example (3)
Calculate the body mass index for the following observation .
height = 1.79, weight = 68.7

Solution
height=1.79;
weight=68.7;
BMI=

Dr. Muhammad Yousuf Tufail (NEDUET) Matlab Lecture 1 4/5


Calculation of Body mass index(BMI)

weight
BMI = height 2

Example (3)
Calculate the body mass index for the following observation .
height = 1.79, weight = 68.7

Solution
height=1.79;
weight=68.7;
BMI= weight/heightˆ(2);

Dr. Muhammad Yousuf Tufail (NEDUET) Matlab Lecture 1 4/5


Calculation of Body mass index(BMI)

weight
BMI = height 2

Example (3)
Calculate the body mass index for the following observation .
height = 1.79, weight = 68.7

Solution
height=1.79;
weight=68.7;
BMI= weight/heightˆ(2);
BMI

Dr. Muhammad Yousuf Tufail (NEDUET) Matlab Lecture 1 4/5


Calculation of Body mass index(BMI)

weight
BMI = height 2

Example (3)
Calculate the body mass index for the following observation .
height = 1.79, weight = 68.7

Solution
height=1.79;
weight=68.7;
BMI= weight/heightˆ(2);
BMI
21.4413

Dr. Muhammad Yousuf Tufail (NEDUET) Matlab Lecture 1 4/5


Calculation of Body mass index(BMI)

weight
BMI = height 2

Example (4)

Dr. Muhammad Yousuf Tufail (NEDUET) Matlab Lecture 1 5/5


Calculation of Body mass index(BMI)

weight
BMI = height 2

Example (4)
Calculate the body mass index for the following observation.
height = 1.79, weight = 74.2

Dr. Muhammad Yousuf Tufail (NEDUET) Matlab Lecture 1 5/5


Calculation of Body mass index(BMI)

weight
BMI = height 2

Example (4)
Calculate the body mass index for the following observation.
height = 1.79, weight = 74.2

Solution

Dr. Muhammad Yousuf Tufail (NEDUET) Matlab Lecture 1 5/5


Calculation of Body mass index(BMI)

weight
BMI = height 2

Example (4)
Calculate the body mass index for the following observation.
height = 1.79, weight = 74.2

Solution
23.1578

Dr. Muhammad Yousuf Tufail (NEDUET) Matlab Lecture 1 5/5

You might also like