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:


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