# MATLAB function M-file for Mclaurin expansion

Develop a function M-file named fun_xb that evaluates the following series:

See attached file for full problem description.

where values of x and n are passed to the function through arguments. The foregoing series is a truncated Mclaurin expansion. (Taylor series expansion about the point x=0) of log(1+x) and converges for -1<x<1. Knowing this, test the function for selected x values such as x= -0.5 and 0.5, with n=1, 2,3,5,10,20,50 and compare graphically with log(1+x). (Convergence becomes increasingly difficult as x approaches -1 or 1.)

Â© BrainMass Inc. brainmass.com March 4, 2021, 6:32 pm ad1c9bdddfhttps://brainmass.com/computer-science/matlab/matlab-function-file-mclaurin-expansion-49118

#### Solution Preview

Place the following text into a fun_xb.m file and run it from the command window of MatLab - it will calculate all that is requested and plot the requested plots.

I gave the x limits ...

#### Solution Summary

Using step by step method and problem solving, this solution provides code for developing a function that has the necessary requirements.