row wise Inner product of two matrices without using loop
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have two matrices A= 40 x 50 and B = 61 x 50. I want to get the row wise dot product for the entire combination of rows of two matrices. Using for loop it is something like this
for i=1:40
for j=1:61
inner_prod(i,j) = dot (A(i,:),B(j,:);
end
end
Is there any way to do this avoiding the for loop and less execution time ?
0 Kommentare
Antworten (2)
Image Analyst
am 18 Feb. 2019
Well that code is not right. But anyway, don't worry about a for loop with 40*61 iterations. That will be so fast there is no possible way you will notice how long it takes.
Siehe auch
Kategorien
Mehr zu Multidimensional Arrays finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!