Explore BrainMass
Share

Explore BrainMass

    MATLAB function M-file for Mclaurin expansion

    This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

    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 October 9, 2019, 5:08 pm ad1c9bdddf
    https://brainmass.com/computer-science/matlab/matlab-function-file-mclaurin-expansion-49118

    Attachments

    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.

    $2.19