symbolic matrix multiplication by Ryacas

99封情书 提交于 2021-02-08 03:38:59

问题


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.


回答1:


Try this:

> mat1 * mat2
expression(list(list(x^2 + 6, x^2 + 12 * x), list(x^4 + 3 * x, 
    x^4 + 6 * x^2)))


来源:https://stackoverflow.com/questions/21858668/symbolic-matrix-multiplication-by-ryacas

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!