Hi there,
I have two quite large matrices with the following sizes:
A = rand(94037,2240) B=rand(2240,2240)
I would like to mutiply each column of A by the transpose of each column of B (bascially two vector multiplication). Therefore each mutiplcation gives me a 2D matrix wih size (94037,2240) and I would like to store the result of each multiplication in a 3d MATRIX.
The thing is I can do this with for-loop as show below but its very slow and in the middle of operation matlab exist, because its quite heavy.
S = zeros(94037,2240,2240);
for i=1:1:2240
S(:,:,i) =A(:,i)*(B(:,i))';
end
Is there anyway I can do this without using for loop to speed up the process ?
Thanks for the help.
Best,
Nikan
댓글 수: 2
이 댓글에 대한 바로 가기 링크
https://kr.mathworks.com/matlabcentral/answers/716378-column-multiplication-of-two-2d-matrices#comment_1262178
이 댓글에 대한 바로 가기 링크
https://kr.mathworks.com/matlabcentral/answers/716378-column-multiplication-of-two-2d-matrices#comment_1262178
이 댓글에 대한 바로 가기 링크
https://kr.mathworks.com/matlabcentral/answers/716378-column-multiplication-of-two-2d-matrices#comment_1262198
이 댓글에 대한 바로 가기 링크
https://kr.mathworks.com/matlabcentral/answers/716378-column-multiplication-of-two-2d-matrices#comment_1262198
댓글을 달려면 로그인하십시오.