Question: Problem 1 [ 2 0 marks ] . Suppose you need to implement a routine to compute the stan - dard trigonometric function cos (
Problem marks Suppose you need to implement a routine to compute the stan
dard trigonometric function cosx on an embedded microprocessor that does not have a
builtin trigonometric function. You are require to develop a MATLAB function that com
putes cosx without using the builtin cosx function. Your routine should use only basic
arithmetic operations, including multiplies, divides, additions and subtractions.
a marks Develop a function for cosx in MATLAB and optimize your code. Addi
tionally, ensure to include comments as necessary for clarity and understanding.
b 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
pi pi Provide insights derived from the obtained results.
c 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
