简体   繁体   中英

Numpy multiplication matrix (more than two matrix)

If I need to do multiplication between 5 matrix (taking into account the good shape of the matrix to be able to multiplicate), np.dot doesn't work. For ex, in matlab you can easily write:

Rf = T^-1 * S^-1 * R * S * T

to multiply two matrices you can use: np.matmul(matrix1, matrix2).shape then use for loop to multiply 5 matrices.

for more info check numpy documentation : https://docs.scipy.org/doc/numpy/reference/generated/numpy.matmul.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM