Can't understand this simple matrix multiplication in python
It works for me.

&gt;&gt;&gt; import numpy as np
&gt;&gt;&gt; dx = np.matrix([[ 1.6, 3.6, 0.4, 14.4, 25.6],
... [10. , 10. , 0.4, 14.4, 3.6],
... [ 0.4, 0. , 0. , 1.6, 10. ],
... [ 6.4, 0. , 3.6, 1.6, 0.4],
... [14.4, 0. , 25.6, 0.4, 6.4]])
&gt;&gt;&gt; 10 * dx
matrix([[  16.,   36.,    4.,  144.,  256.],
        [ 100.,  100.,    4.,  144.,   36.],
        [   4.,    0.,    0.,   16.,  100.],
        [  64.,    0.,   36.,   16.,    4.],
        [ 144.,    0.,  256.,    4.,   64.]])


You might want to check if you have redefined dx before the multiplication.