Question: please i need the answer as screenshots from matlab, thanks in advance 3. The cosine function: The cosine function can be evaluated by the following
please i need the answer as screenshots from matlab, thanks in advance 3. The cosine function: The cosine function can be evaluated by the following infinite series ... Cosx=1 2! 4! 6! (a) Write a function that needs as an input the number of terms n of the cosine series and the value of x and then it calculates the series up to the term. Make sure that the function does the following: (1) calculates and stores the value of the true percent relative error for each value of k from k = 1 to kon where n is the number of terms given by the user. (11) plots the true percent relative error for each value of k from k = 1 to kn. It labels the x- axis, the y-axis and adds a legend. The plot has to be logarithmic on both x and y axes (ie. log-log plot which can be done by using loglog instead of plot) (lil) times itself using tic; toc; (b) Run the function for the case x stand n 170 and report the final plot, and the time of the calculation (From your log-log plot In part (b), how many terms are enough to reach percent relative error less than 1096, (d) If you look at the series, there is an issue in using 200 terms or more. What is the issue
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
