Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
SOLUTION – PRACTICE 2
A) Relational/Logical exercises
Refer to Matlab
1. n = 7 gives m = 8
n = 9 gives m = -1
n = -10 gives m = -11
2. z = 1 gives w = 2
z = 9 gives w = 0
z = 60 gives w = sqrt(60)
z = 200 gives w = 200
3. T = 50 gives h = 0
T = 15 gives h = 31
T = 0 gives h = 1
4. x = -1 gives y = 500
x = 5 gives y = 20
x = 30 gives y = 120
x = 100 gives y = 500
5.
Page 1 of 4
Taylor’s University Computing Applications for Engineers
School of Engineering (ENG2314) Dr Thein Chung Ket
Q1a)
r=
10000 20000 35200 100000 200000
>> v./r
ans =
0.0120 0.0040 0.0031 0.0020 0.0018
Q1b)
>> p= v.*v
p=
14400 6400 12100 40000 122500
>> z=p./r
z=
1.4400 0.3200 0.3438 0.4000 0.6125
Page 2 of 4
Taylor’s University Computing Applications for Engineers
School of Engineering (ENG2314) Dr Thein Chung Ket
Q2)
Q3a)
> force = [400 550 700 500 600]
force =
400 550 700 500 600
Page 3 of 4
Taylor’s University Computing Applications for Engineers
School of Engineering (ENG2314) Dr Thein Chung Ket
>> W = force.*distance
W=
800 275 525 750 1800
Q3b)
>> z=sum(W)
z=
4150
Page 4 of 4