Create polynomial
Write the following format in MATLAB to create an expression polynomial
p = [a0 a1 a2……… an-1 an];
MATLAB will automatically assign the vector elements to the coefficient values in descending order.
p = [-9 2 -3 6 -56];
poly2sym(p)
Operation result: The
poly2sym
function can express a polynomial vector into a symbolic polynomial form.
Create characteristic polynomial
- The leading coefficients of the polynomials generated by the characteristic polynomials are all 1.
- The characteristic matrix of order n generally produces a polynomial of order n.
a = [1 2 3; 4 5 6; 7 8 9];
p1 = poly(a)
poly2sym(p1)
operation result:
Create polynomial from roots
Generate a polynomial with real coefficients, and the complex number in the root must correspond to the conjugate.
root = [-5 -3+4i -3-4i];
p = poly(root)
poly2sym(p)
operation result:
Find the roots of a polynomial
Created from a polynomial:
p = [1 -4 0 12 -9];
Using the roots
function or compan
functions with the eig
functions can be obtained using all the roots of a polynomial.
Calculation result: