Skip to content

seriessum

Sum of a power series.

v = seriessum(x, n, m, coefficients)

Returns sum_i a_i * x^(n + i*m) where a_i is the i-th element of coefficients. Useful for evaluating Taylor / Maclaurin truncations.

% Approximate exp(0.5) using 4 terms of Taylor series:
seriessum(0.5, 0, 1, [1 1 1/2 1/6]) % ≈ 1.6458
  • sum — Sum elements of an array.
  • polyval — Evaluate a polynomial.