Trying to calculate this in vba: a(), b(), and c() are all arrays whose indexes go from 1 to 10. I know the values of array a and b. I need to calculate values of array c. The values are calculated as following:
c(1) = a(1) * b(1)
c(2) = a(1) * b(2) + a(2) * b(1)
c(3) = a(1) * b(3) + a(2) * b(2) + a(3) * b(1)
...
c(10) = a(1) * b(10) + a(2) * b(9) +...+ a(9) * b(2) + a(10) * b(1)
Instead of writing out the ten equations one by one, is there an easier way to do this?
c(1) = a(1) * b(1)
c(2) = a(1) * b(2) + a(2) * b(1)
c(3) = a(1) * b(3) + a(2) * b(2) + a(3) * b(1)
...
c(10) = a(1) * b(10) + a(2) * b(9) +...+ a(9) * b(2) + a(10) * b(1)
Instead of writing out the ten equations one by one, is there an easier way to do this?