how to multiply the following

1 view (last 30 days)
Adelaide
Adelaide on 10 Apr 2019
Answered: Matt J on 10 Apr 2019
Hi,
I need a code that multiplies each row of A one by one with each row of B (with corresponding element) and then sums the result. The resulting matrix has to be 3x3. This is easier to explain with an illustration. For example the first element of the resulting matrix would be equal to 0.06(0.02) + 0.16(0.03). The second element in the first row would be 0.06(0.09) + 0.16(0.14) and so on.
I am confused whether I have to use a loop for this or if there is a simper way. Note that my dataset is larger. Thanks in advance.

Accepted Answer

Matt J
Matt J on 10 Apr 2019
result = A*B.';

More Answers (0)

Categories

Find more on Creating and Concatenating Matrices 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!