You are on page 1of 5

Muhammad Hussain Tahir 2015-CE-182

LAB # 9
OBJECT:
Use for Matrix Laboratory software to perform mathematical, scaler,
vector, matrix operation.

Question 1.
>> ans=4+12+144-36-10*18/12

ans =

109

Question 2.
>> ans2=10*14+18-188*14/24

ans2 =

48.3333

Question 3.
>> ans3=2^10

ans3 =

1024

Question 4.
Total cost of item ?

Average of total cost ?

S no Item Quantity Unit cost


1 Pen 40 10
2 Stapler 20 40
3 Eraser 45 2
4 Paper rim 4 350
5 Pencil 100 3

CA & ED (CE-105) Page 50


Muhammad Hussain Tahir 2015-CE-182

>> pen=40*10

pen =

400

>> stapler=20*40

stapler =

800

>> eraser=45*2

eraser =

90

>> paperrim=4*350

paperrim =

1400

>> pencil=100*3

pencil =

300

>> totalcost=pen+stapler+eraser+paperrim+pencil

totalcost =

2990

>> average=totalcost/5

average =

598

Question 5(a).
Faranhiet to celcius. ( c=5 )
>> faranhiet=(5*9/5)+32

faranhiet =

41

CA & ED (CE-105) Page 51


Muhammad Hussain Tahir 2015-CE-182

Question 5(b).
Lense formula :
>> p=2

p=

>> q=3

q=

>> f=p*q/p+q

f=

Question 6.
Marks sheet of three subjects:
>> display('Marks sheet of three subjects')
Marks sheet of three subjects

>> display('Enter your subject marks')


Enter your subject marks

>> cs=input('Enter your marks out of 100= ')


Enter your marks out of 100= 77

cs =

77

>> os=input('Enter your marks out of 100= ')


Enter your marks out of 100= 60

os =

60

>> cg=input('Enter your marks out of 100= ')


Enter your marks out of 100= 81

cg =

81

CA & ED (CE-105) Page 52


Muhammad Hussain Tahir 2015-CE-182

>> TM=cs+os+cg

TM =

218

>> totalmarks=TM/300

totalmarks =

0.7267

>> percentage=totalmarks*100

percentage =

72.6667

>> display('Your percentage is')

Your percentage is

>> percentage

percentage =

72.6667

CA & ED (CE-105) Page 53


Muhammad Hussain Tahir 2015-CE-182

Home Task:
Question 7.
Equations of motion:
>> vi=input('Enter Initial velocity= ')
Enter Initial velocity= 2

vi =

>> vf=input('Enter final velocity= ')


Enter final velocity= 5

vf =

>> s=input('Enter Distance= ')


Enter Distance= 6

s=

>> t=input('Enter time= ')


Enter time= 2

t=

Equation 1:
>> a=vf^2+vi^2/2*s

a=

37

Equation 2:
>> VF=vi+a*t

VF =

76

CA & ED (CE-105) Page 54

You might also like