2

I define two matrices mat1 and mat2 in Sym class which is suitable for Ryacas symbolic computation:

library(Ryacas)
x <- Sym("x")

mat1 <- List(
List(x, 2),
List(x^3, x))

and

mat2 <- List(
List(x, x),
List(3, 6 * x))

now the question is how I can have the symbolic multiplication of these two matrices by Ryacas package?

Thank you in advance.

Ehsan Masoudi
  • 712
  • 10
  • 19

1 Answers1

2

Try this:

> mat1 * mat2
expression(list(list(x^2 + 6, x^2 + 12 * x), list(x^4 + 3 * x, 
    x^4 + 6 * x^2)))
G. Grothendieck
  • 254,981
  • 17
  • 203
  • 341