Description Usage Arguments Details Value Methods (by class) Examples
Returns a matrix obtained by applying a function degree()
for each element of the matrix.
1 2 3 4 5 6 7 8 9 10 | matrix.degree(x)
## S4 method for signature 'matrix'
matrix.degree(x)
## S4 method for signature 'polynomial'
matrix.degree(x)
## S4 method for signature 'polyMatrix'
matrix.degree(x)
|
x |
an R object |
Degree of each item is calculated using degree()
which is defined for polynomials
as the highest degree of the terms with non-zero coefficients.
For convenience this function is defined for any object, but returns zero for non polynomial objects.
If the argument is a matrix, the result is a matrix of the same size containing the degrees of the matrix items.
For a numerical matrix the value is always a zero matrix of the same size
For a polynomial the value is the degree of the polynomial
matrix
: the degree of a numerical matrix is a zero matrix for compatibility
polynomial
: the degree of a polynomial
polyMatrix
: a matrix of degrees for each polynomial item of the source matrix
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | # numerical matrices
matrix.degree(matrix(1:6, 2, 3))
## [,1] [,2] [,3]
## [1,] 0 0 0
## [2,] 0 0 0
# polynomials
matrix.degree(parse.polynomial("x + 1")) ## 1
matrix.degree(parse.polynomial("x^3 + 1")) ## 3
matrix.degree(parse.polynomial("1")) ## 0
# polynomial matrices
matrix.degree(parse.polyMatrix(
"x; x^2 + 1",
"0; 2x"))
## [,1] [,2]
## [1,] 1 2
## [2,] 0 1
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.