Ryacas 的符号矩阵乘法 [英] symbolic matrix multiplication by Ryacas
本文介绍了Ryacas 的符号矩阵乘法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在Sym
类中定义了两个矩阵mat1
和mat2
,适用于Ryacas符号计算:
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))
和
mat2 <- List(
List(x, x),
List(3, 6 * x))
现在的问题是如何通过 Ryacas 包对这两个矩阵进行符号乘法?
now the question is how I can have the symbolic multiplication of these two matrices by Ryacas package?
提前致谢.
推荐答案
试试这个:
> mat1 * mat2
expression(list(list(x^2 + 6, x^2 + 12 * x), list(x^4 + 3 * x,
x^4 + 6 * x^2)))
这篇关于Ryacas 的符号矩阵乘法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文