I have two matrix X and Y of shape 7800×784 and 784×7800. X !=Y'. I want to multiply each row of X with each column of Y to get a 7800×1 matrix. Basically I want the diagonal elements of X*Y matrix without performing the redundant operations. Is there a vectorised way of performing this operation? Thanks!!
MATLAB: Multiplying each row vector with each column vector.
MATLABmatrix manipulationvectorization
Best Answer