Compute the polynomial given a set of coefficients and a constant value x
Compute the polynomial given a set of coefficients and a constant value x
$$ f(x,i) = \begin{cases} c_i + x * f(x,i+1) & \text{where} i < n\\ c_i & \text{otherwise} \end{cases}
Implementation of the matlab function polyval which evaluates the coefficients in descending order from nth order to 1. In this function the coefficients are taken in ascending order so that instead of
p(x) = p_1 xn + p_2 xn-1 + ... + p_n x^1 + p_{n+1}
Where the coefficients are specified from highest order (n) to lowest (1)
We implement:
p(x) = p_0 + p_1 x1 + p_2 x2 + p_3 x3 + ... p_n xn
Or rather
p(x) = p_0 + \sum_{i=1}n p_i xi
This is a convenience function for the underlying polynomial defined in Continued series.