Polynomial roots - MATLAB roots - MathWorks

Loading...

roots Polynomial roots

Syntax r = roots(p)

Description r = roots(p) returns the roots of the polynomial represented by p as a column vector. Input p is a vector containing n+1 polynomial coefficients, starting with the coefficient of n . A coefficient of 0 indicates an intermediate power that is not present in the equation. For example, p = [3 2 -2] represents the polynomial . The roots function solves polynomial equations of the form

example

. Polynomial equations contain a single variable with nonnegative exponents.

Examples

collapse all

Roots of Quadratic Polynomial Solve the equation

.

Try This Example

Create a vector to represent the polynomial, then find the roots. p = [3 -2 -4]; r = roots(p) r = 1.5352 -0.8685

Roots of Quartic Polynomial Solve the equation

.

Try This Example

Create a vector to represent the polynomial, then find the roots. p = [1 0 0 0 -1]; r = roots(p) r = -1.0000 + 0.0000i 0.0000 + 1.0000i 0.0000 - 1.0000i 1.0000 + 0.0000i

Input Arguments

collapse all

p — Polynomial coefficients vector Polynomial coefficients, specified as a vector. For example, the vector [1 0 1] represents the polynomial .

, and the vector [3.13 -2.21 5.99] represents the polynomial

For more information, see Create and Evaluate Polynomials. Data Types: single | double Complex Number Support: Yes

Tips •

Use the poly function to obtain a polynomial from its roots: p = poly(r). The poly function is the inverse of the roots function.



Use the fzero function to find the roots of nonlinear equations. While the roots function works only with polynomials, the fzero function is more broadly applicable to different types of equations.

Algorithms The roots function considers p to be a vector with n+1 elements representing the nth degree characteristic polynomial of an n-by-n matrix, A. The roots of the polynomial are calculated by computing the eigenvalues of the companion matrix, A. A = diag(ones(n-1,1),-1); A(1,:) = -p(2:n+1)./p(1); r = eig(A) The results produced are the exact eigenvalues of a matrix within roundoff error of the companion matrix, A. However, this does not mean that they are the exact roots of a polynomial whose coefficients are within roundoff error of those in p.

Extended Capabilities C/C++ Code Generation Generate C and C++ code using MATLAB® Coder™.

See Also fzero | poly | polyval | residue

Topics Roots of Polynomials Create and Evaluate Polynomials

Introduced before R2006a

Loading...

Polynomial roots - MATLAB roots - MathWorks

roots Polynomial roots Syntax r = roots(p) Description r = roots(p) returns the roots of the polynomial represented by p as a column vector. Input p...

42KB Sizes 2 Downloads 24 Views

Recommend Documents

Polynomial Roots -- from Wolfram MathWorld
The roots of a polynomial equation may be found exactly in the Wolfram Language using Roots[lhs==rhs, var], or numerical

Finding the Roots of a Polynomial
2 4. x x x x. -. - +. Find the roots of y=x. 4 – 3x. 3 – 2x. 2. + 4x. Rewrite the polynomial: ( )(. ) 2. 1. 2 4. x x

Roots & Factors
Roots & Factors. Roots of a polynomial. A root of a polynomial p(x) is a number α ∈ R such that p(α) = 0. Examples.

`roots` doesn't find all roots of a polynomial - ASKSAGE: Sage Q&A
Dec 7, 2015 - Let's consider the following example: w = x^4 - (1+3*i)*x^3 - (2-4*i)*x^2 + (6-2*i)*x - 4 - 4*i p = x^4 +

scenic-roots
Feb 3, 2016 - Anemia ini terjadi karena peningkatan volume plasma tanpa dibarengi dengan perubahan bentuk sel darah mera

MATLAB Answers - MATLAB Central - MathWorks
View questions and answers from the MATLAB Central community. Find detailed answers to questions about coding, structure

6.6 Finding Rational Roots
6.6 Finding Rational Roots. Objective: Find the rational zeros (or roots) of a polynomials function. The polynomial func

Graphing and Finding Roots of Polynomial Functions | She Loves Math
For a polynomial function Standard Form with integers as coefficients (no fractions or decimals), if p = the factors of

- MATLAB & Simulink - MathWorks
By Category: Desktop. Language and Programming. Mathematics. Graphics. Data Import and Export. Data Analysis. App Buildi

Finding roots of polynomial equations. Rational integral equations
Let r be any number. If Q(x) is the quotient obtained by dividing a polynomial G(x) by (x - r) and R is the constant rem

Kaitou Joker | Lowest Price | IOS (iPad/iPhone)