Practical 6

Polynomials in MATLAB

In MATLAB, a polynomial is represented by an array of its coefficients of the powers. The MATLAB polynomial functions allow us to perform some useful commands such as addition, multiplication and finding the roots of polynomials.

Example:

would be entered as

p = [3 -4 0 7 -9 3],

so that p(1)=3 is a coefficient for (term with the highest power), p(2) =-4 is ,.., p(6)=3 – for (the lowest power term).

> Exercise: Creating Coefficient Arrays

Write the polynomial p(x) corresponding to array of coefficients q

q = [4 5 -6]                            

> Type in the coefficient array s corresponding to polynomial s(x)

                            s=[ ]