Question: Problem 2 (20 points) (CCO 1) / MatlabGrader The natural logarithm of a number 2 > 0 can be calculated by the series 2:2 1)2n+1

Problem 2 (20 points) (CCO 1) / MatlabGrader The natural logarithm of a number 2 > 0 can be calculated by the series 2:2 1)2n+1 In = (2n + 1)(x + 1)2n+1 n=0 (1) a) Write a Matlab function myLnx that takes as input x and the number N to estimate In x using N Inr 2:1 1)2n+1 (2n + 1)(x + 1)2n+1' (2) n=0 and returns as outputs the estimate for In x together with the corresponding true relative error. For the true value of In z use Matlab's build-in function log(x). Do not print any results to screen or do any plotting within the function. b) Write a script that calls your function myLnx to calculate and report the estimated value of Inc and its true relative error for x = 4.5 and N = 10, 20, 30, 40, and 50 printing at least 15 digits. Problem 2 required submission: Printout of well commented function and script you coded included in your Gradescope submission; Printout of the results of calling your function for b) with at least 15 digits; Upload of all your Matlab .m function and script files to the THE1 Upload Code assignment on Gradescope
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
