sna*_*ile 14
如果您的问题是:如何在同一时间计算矩阵M的逆矩阵:
M_inverse = M.inv()
Run Code Online (Sandbox Code Playgroud)
至于如何创建矩阵:
M = Matrix(2,3, [1,2,3,4,5,6])
Run Code Online (Sandbox Code Playgroud)
将为您提供以下2X3矩阵:
1 2 3
4 5 6
请参阅:http://docs.sympy.org/0.7.2/modules/matrices/matrices.html
这是我们如何计算符号矩阵的逆的示例(从问题中获取):
import sympy as sym
# Not necessary but gives nice-looking latex output
# More info at: http://docs.sympy.org/latest/tutorial/printing.html
sym.init_printing()
sx, sy, rho = sym.symbols('sigma_x sigma_y rho')
matrix = sym.Matrix([[sx ** 2, rho * sx * sy],
[rho * sx * sy, sy ** 2]])
Run Code Online (Sandbox Code Playgroud)
可以进一步简化,如sym.simplify(matrix.inv()):

| 归档时间: |
|
| 查看次数: |
7750 次 |
| 最近记录: |