Processing math: 100%

First time here? Check out the FAQ!

Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to get the coefficient of xn in symbolic expression of matrix

I have the symbolic matrix:

x = var('x')
h = Matrix(SR, [[x,2],[3*x+5,4]])

How can I get the coefficients of xn in symbolic expression of matrix. I need to get the follow two matrix from that one:

[[1,0],[3,0]]
[[0,2],[5,4]]