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 to 2
  • b3 equal to 5

(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 to 3
  • r equal to 1
  • theta equal to 30 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.