using the taylor series function of matlab

1 visualización (últimos 30 días)
SonOfAFather
SonOfAFather el 4 de Sept. de 2012
Hello,
I am trying to write a piece of code that allows me to input the numbers of terms in a taylor series and I know that i must use the "k = input('numbers of terms')" comand, when I use: (here is my code)
k = input('total number of terms in the taylor series:');
syms x;
taylor(exp(x), x, 'ExpansionPoint', k)
is k the number of terms? and if not how do i set the number of terms to be expressed?
thank you in advance.

Respuesta aceptada

Walter Roberson
Walter Roberson el 4 de Sept. de 2012
taylor(exp(x), x, 'Order', k)
Note that this will expand around x=0 unless you provide an expansion point.
  4 comentarios
Azzi Abdelmalek
Azzi Abdelmalek el 4 de Sept. de 2012
the result is only correct for small values of x
SonOfAFather
SonOfAFather el 5 de Sept. de 2012
apparently I am completely off base here and don't need to actuallyneed to use the taylor() keyword but need to write a for loop that will actually preform a taylor series for me. sorry that i may have wasted anybodies time with the original question.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Mathematics and Optimization en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by