V A Ab+b H: Machine Problem
V A Ab+b H: Machine Problem
Answer the following problems using commands in Matlab. Make sure to indicate your commands in your
submission and .
1. Compute the following using the correct order of operations:
a. 2−4∗(5 3−2+2∗( 5+6 ))
4∗5 3−2
b. 2−
2∗(5+6)
4∗53−2
2−
c. 2
+6
5
2. Compute for the volume of a truncated pyramid with a = 5, b = 3 and h = 10, given the formula:
1
V = ( a2 +ab+ b2 ) h
3
ANSWERS
1.
a. Answer: -106
Command:
>>a=2
a =
>>b=5^(3-2)
b =
>>c=5+6
c =
11
>>d=2*c
d =
22
>>e=4*(b+d)
e =
108
>>f=a-e
f =
-106
b. Answer: 1.0909
Command:
>>g=4*b
g =
20
>>h=g/d
h =
0.9091
>>i=a-h
i =
1.0909
c. Answer: -1.1250
Command:
>>j=(2/5)+6
j =
6.4000
>>k=g/j
k =
3.1250
>>l=a-k
l =
-1.1250
2. Answer: 163.3333
Command:
>>a=5; b=3; h=10;
>>V=1/3*(a^(2)+a*b+b^(2))*h
V =
163.3333