Question: Problem 1 [ 2 0 marks ] . Suppose you need to implement a routine to compute the stan - dard trigonometric function cos (

Problem 1[20 marks]. Suppose you need to implement a routine to compute the stan-
dard trigonometric function cos(x) on an embedded microprocessor that does not have a
built-in trigonometric function. You are require to develop a MATLAB function that com-
putes cos(x) without using the built-in cos(x) function. Your routine should use only basic
arithmetic operations, including multiplies, divides, additions and subtractions.
a.[8 marks] Develop a function for cos(x) in MATLAB and optimize your code. Addi-
tionally, ensure to include comments as necessary for clarity and understanding.
b.[8 marks] Examine three distinct accuracy levels to evaluate their influence on the ac-
curacy of your computations. Plot absolute errors against x values, within the interval
[2\pi ,3\pi ]. Provide insights derived from the obtained results.
c.[4 marks] Analyze the relationship between average absolute error and the order of
accuracy. Provide insights derived from the obtained results.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!