Cosmetic Changes of Polynomials

To display the traditionally formatted polynomial that corresponds to a row vector containing coefficients, use gfpretty. To truncate a polynomial by removing all zero-coefficient terms that have exponents higher than the degree of the polynomial, use gftrunc. For example,

polynom = gftrunc([1 20 394 10 0 0 29 3 0 0])
gfpretty(polynom)

The output is below.

polynom =

     1    20   394    10     0     0    29     3


                                   2       3       6      7
                   1 + 20 X + 394 X  + 10 X  + 29 X  + 3 X 


© 1994-2005 The MathWorks, Inc.