Learn R Programming

polyMatrix (version 0.3.1)

pMdiag: Generates a diagonal polynomial square matrix

Description

The genareted matrix a diagonal matrix of the given dimension with the diagonal elements given as input.

Usage

pMdiag(p, diag_dim, symb="x")

Arguments

p

a polynomial object or list of polynomial objects for diagonal elements

diag_dim

the row and column size of the diagonal matrix

symb

the symbol used in the polynomial matrix

Value

A 'polyMatrix' class type polynomial matrix with given diagonal elements.

See Also

diag

Examples

Run this code
# NOT RUN {
pMdiag(ch2pn("1"),3)
pMdiag(ch2pn("1+2*x+3*x^2"),3)
pMdiag(ch2pn(c("x","2*x","3*x","4*x")),3)
pMdiag(ch2pn(c("x","2*x","3*x","4*x")),6)
# }

Run the code above in your browser using DataLab