Use a for-loop for multiply colums of two arrays
2 views (last 30 days)
Show older comments
Hallo guys,
How can i multiply rows of two different arrays in a for loop?
So my starting point is a 4x8 (A) matrix and a 4x1 (B) matrix and I want to multiply point A(1x1) with B(1x1), A(2x1) and B(2x1) ... A(1x2) and B(1x1) etc.
I tried this: Mw(4x8) and m(4x1)
Steigung1_neu = zeros(1,8);
startWert = (1);
endWert = (8);
N1 = 1;
for index = startWert:1:endWert
Steigung1_neu(N1) = Mw(2,index)/m(2);
N1 = N1 +1;
end
This just multiplys every row, but I want to multiply every colum.
Would be nice, if you guys can give some tipps.
1 Comment
See Also
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!