Question: Calculating an equation of matrix

Hi, I have a J(5x5 diagonal matrix), I have M(5x5 matrix). Let i be my rows and j be my columns. I'm trying to calculate [A]ij = ([M]ij)/(JJi-JJj-2)

I cant think of a proper way to do it. Please help.

M:=Matrix([[2,5,7,9,8],[8,5,2,6,8],[5,4,5,5,7],[1,4,9,6,6]])

J:=Vector([3,5,4,9,6])

JJ:=DiagonalMatrix(J)

A11=2/(3-3-2), A12=5/3-5-2, A13=7/3-4-2  etc... A55

Please Wait...