TeX Matrix Polynomials
as_tex_matrixpoly.RdTeX Matrix Polynomials
Examples
coefs = array(round(rnorm(2*3*1), 1), dim = c(2,3,2))
as_tex_matrixpoly(coefs)
#> [1] "\\begin{pmatrix}\n 1.5 + 1.5z & 0.3 + 0.3z & -0.6 - 0.6z \\\\\n -0.8 - 0.8z & -0.5 - 0.5z & 1.5 + 1.5z \\\\\n\\end{pmatrix}"
as_tex_matrixpoly(coefs, x = 'x', as_matrix_of_polynomials = FALSE)
#> [1] " \\begin{pmatrix}\n 1.5 & 0.3 & -0.6 \\\\\n -0.8 & -0.5 & 1.5 \\\\\n\\end{pmatrix} +\n \\begin{pmatrix}\n 1.5 & 0.3 & -0.6 \\\\\n -0.8 & -0.5 & 1.5 \\\\\n\\end{pmatrix} x"