Question: Problem 2 : Understanding of Errors ( using an example of the cosine series ) The algorithm for the cosine Taylor's series expansion is given
Problem : Understanding of Errors using an example of the cosine series
The algorithm for the cosine Taylor's series expansion is given as follows:
cdots
a Create a user defined function to approximate the value of cosine the algorithm above using a whileloop to ensure that the algorithm runs until the relative error is below a given error tolerance maxtol A partially completed code has been provided remove the "part" from the function handle before running
b Test the function created in part a by evaluating at and maxtol
c Modify slightly the MATLAB function cosinetaylorN so that the whileloop checks both the error tolerance and the maximum number of iterations maxitr In other words, the loop terminates when either the error is sufficiently small, or the maximum number of iterations is exceeded. The required inputs and outputs for the fulction are given below:
function cosinetaylor maxtol, maxitr
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
