1 Arithmetic
Open and edit the script q1.m
provided to you to answer the parts of this question.
(a) [1 mark]
Create the following three variables having the specified values:
b1
equal to-1
b2
equal to2
b3
equal to5
(b) [2 marks]
Create the variable named y
whose value is equal to:
\[ y = b_1 + \frac{1}{b_2 + \frac{1}{b_3 + 1}} \]
You must enter the equation shown above and you must use the variables b1
, b2
, and b3
in your answer.
(c) [1 mark]
Create the following two variables having the specified values:
R
equal to3
r
equal to1
theta
equal to30
degrees
(d) [2 marks]
Create the variable named x
whose value is equal to:
\[ x = (R + r) \cos(\theta) - r \cos\left(\frac{R + r}{r}\theta\right) \]
You must enter the equation shown above and you must use the variables R
, r
, and theta
in your answer.