Obtain Polynomial Coefficients from the roots
%By Chukwunomso Agunwamba
%This m-file obtains the coefficients of a polynomial from its roots
%(it
is faster and has simpler code than the coeff.m that I wrote, and I
include it here for comparison. %They perform the same function that
poly.m does.)
##
##This mathematical code is provided as is, for the end user to be able to use it
##and to edit it for educational purposes. However, any modified version must
##include my name as the original producer of the code.
##The name of the mfile code is coefffaster, not to be confused with the
##function called coeffs from the symbolic toolbox, which is different.
#The coeffs function takes a SYMBOLIC POLYNOMIAL and extracts the coefficients.
##This function, that I wrote, takes the ROOTS and constructs the coefficients.
##coefffaster has one input argument, being the prescribed roots.
##The output is arranged in increasing powers, not in decreasing powers.
##It is faster due to recursive method I used that sends past calculated
##information into the calculation of current information. On the other hand,
##Coeff.m is not with recursion.
##
##Usage syntax example:
##
##
##C = coefffaster([1 2 3])
##C =
##
## -6 11 -6 1