Question: Using Matlab: a) Write a function that computes the natural logarithm of x, using the Taylor's Series (TS) for log(x) ( natural log). The basic

Using Matlab:Using Matlab: a) Write a function that computes the natural logarithm ofx, using the Taylor's Series (TS) for log(x) ( natural log). Thebasic definition is given in the following formula. (10 points) log(x)=(-1)(k+ 1)*(x-1),k

a) Write a function that computes the natural logarithm of x, using the Taylor's Series (TS) for log(x) ( natural log). The basic definition is given in the following formula. (10 points) log(x)=(-1)(k+ 1)*(x-1),k for 0 2, then you should use the identity of log(x) - log(2) + log(x/2). Do not compute log(2), but use a constant of 0.69314718055994529 We will want to return the number of iterations required to attain the solution, since this shows how well the algorithm converges Prototype function [y, terms] = TS-log ( x, MaxTerms % [y, terms] = TS-log (x, MaxTerms ) ) % Computes log of the number x, using a maximum of MaxTerms in % the Taylor's Series. % Input: x -Number that we want the natural log of. MaxTerms - The maximum number of terms that are to be used. [default: 1000] % Output: y- log of x terms- number of terms used. a) Write a function that computes the natural logarithm of x, using the Taylor's Series (TS) for log(x) ( natural log). The basic definition is given in the following formula. (10 points) log(x)=(-1)(k+ 1)*(x-1),k for 0 2, then you should use the identity of log(x) - log(2) + log(x/2). Do not compute log(2), but use a constant of 0.69314718055994529 We will want to return the number of iterations required to attain the solution, since this shows how well the algorithm converges Prototype function [y, terms] = TS-log ( x, MaxTerms % [y, terms] = TS-log (x, MaxTerms ) ) % Computes log of the number x, using a maximum of MaxTerms in % the Taylor's Series. % Input: x -Number that we want the natural log of. MaxTerms - The maximum number of terms that are to be used. [default: 1000] % Output: y- log of x terms- number of terms used

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!