summing the values of 2 vectors.
-
hello,
how do you sum the values of 2 vectors.
for example:// example A 3 1 // vector A 5 2 8 // vector Bor
example B 5 2 8 // vector A 3 1 // vector Bin the case of example A
3 + 5 =
3 + 2 =
3 + 8 =
1 + 5 =
1 + 2 =
1 + 8 =in the case of example B
5 + 3
5 + 1
2 + 3
2 + 1
8 + 3
8 + 1what kind of looping mechanism would it take?
-
hello,
how do you sum the values of 2 vectors.
for example:// example A 3 1 // vector A 5 2 8 // vector Bor
example B 5 2 8 // vector A 3 1 // vector Bin the case of example A
3 + 5 =
3 + 2 =
3 + 8 =
1 + 5 =
1 + 2 =
1 + 8 =in the case of example B
5 + 3
5 + 1
2 + 3
2 + 1
8 + 3
8 + 1what kind of looping mechanism would it take?
@Natural_Bugger
Outerforloop on vector A, innerforloop on vector B, for the order you specify. Resulting in 6 answers in each example. -
@Natural_Bugger
Outerforloop on vector A, innerforloop on vector B, for the order you specify. Resulting in 6 answers in each example.yeah, i got it already.
i choose the smallest vector for the outer loop and and biggest for the inner.but thnx anyway.