Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

I tried to solve this quistion about

1 visualización (últimos 30 días)
Khalid Al-Yousef
Khalid Al-Yousef el 4 de Abr. de 2020
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
(find Taylor polynomials of order 3 near x=1 for f(x)=ln(x). I got the answer that is log(x) but whene I calclated it I got x-x^2/2+x^3/3)
I wrote
syms x;
f(x)=log(x)
t3=taylor(f,x,1,'order',4);
and I got the answer that is log(x)
MATLAB R2019b
  1 comentario
Walter Roberson
Walter Roberson el 5 de Abr. de 2020
f(x)=log(x)
That command has no semi-colon at the end of it, so MATLAB is going to display the result of f(x), which is going to be log(x)
t3=taylor(f,x,1,'order',4);
That command does have a semi-colon at the end of it, so MATLAB is not going to automatically display the result of the calculation. If you were to remove the semi-colon you would see the taylor approximation.

Respuestas (1)

David Hill
David Hill el 5 de Abr. de 2020
What I got, which should be good for log(x) close to 1, is:
t3 = x - (x - 1)^2/2 + (x - 1)^3/3 - 1;

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by