Is there an equivalent Matlab dot
function in numpy?
The dot
function in Matlab:
For multidimensional arrays A and B, dot returns the scalar product along the first non-singleton dimension of A and B. A and B must have the same size.
In numpy the following is similar but not equivalent:
dot (A.conj().T, B)
In MATLAB, dot(A,B)
of two matrices A
and B
of same size is simply:
sum(conj(A).*B)
Equivalent Python/Numpy:
np.sum(A.conj()*B, axis=0)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With