Learn R Programming

ch (version 0.1.0.2)

sym2poly: Extracting coefficients from polynomials

Description

sym2ploy can extract coefficients from polynomials and gives the roots of polynomials. The roots is calculated from polyroot and the polyroots function.

Usage

sym2poly(x, var = "x")

sym2coef(x, var = "x")

Arguments

x

The polynomials,for examples, '3x^2 + 6x^6 + 2 + 25*x'.

var,

The var from polynomials, for examples, the var of '3x^2 + x^6 + x8 + x*5^2' is 'x'.

Value

sym2poly() returns Coefficients and the roots. sym2coef() only returns coefficients.

Examples

Run this code
# NOT RUN {
sym2poly("3*x^2 + x^5 + x*8")
# }

Run the code above in your browser using DataLab