(adsbygoogle = window.adsbygoogle || []).push({}); 1. The problem statement, all variables and given/known data

Okay, so I need some help with this Matlab program. I never learned Matlab, so I'm trying to do it as best as I can. The question is: Calculate the 2nd and 3rd degree Taylor polynomials for the function f(x)=ln(1+x) about the point a=0 Plot these polynomials and the function on the interval -1<x<3

2. Relevant equations

N/A

3. The attempt at a solution

This is what I have so far. I thought it was right, but Matlab said "Not enough input arguments." What does that mean, and I how do I fix it?

>> figure(1);clf;

x=[-1:.01:3];

y=log*(1+x);

P2= x-(x^2/2)!;

P3= x-(x^2/2)+(x^3/3)!;

figure(1);clf;

plot(x,y,x,P2,'--',x,P3,'-.')

legend('log*(1+x)','P_2','P_3')

xlabel('x')

title('The function and the 2^{nd} and ^{rd} order Taylor Polynomials')

figure(2);clf

plot(x,abs(y-P2),x,abs(y-P3),'--')

legend('log*(1+x)-P_2|','log*(1+x)-P_3|')

xlabel('x')

title('Errors in the two Taylor Polynomials')

Thanks in advance!:)

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Homework Help: Matlab Programming(Need help with the last couple of details)

**Physics Forums | Science Articles, Homework Help, Discussion**