> How would I add the rows of a 640 x 240 2D array together? I mean ,
> the elements of row 1 to the element of row 2 and so on. I want to end
> up with a 1 d array of 640 elements in which each element is the sum
> of the other 240 elements in the rows.
>
> For explaination , like this
> 1 1 1 1 1 1 1 ....... to 640
> +2 2 2 2 2 2 2 .......
> +3 3 3 3 3 3 3 .......
> =6 6 6 6 6 6 6 ....... this is the final 1D array of summed elements.
>
If you drop a For loop and wire the 2D array to the loop, it will
automatically index off the rows the way you need them. To accumulate
the values, you want to add each row to a 1D array that recurculates
through the loop.
To do this, initialize a 1D array constant full of zeroes to the width
of the 2D array. Add a
shift register to the For loop by popping up on
the edge. Wire the 1D constant to the shift register, and inside the
loop add the two 1D arrays together with a plus node. Wire the result
to the right shift register. The answer will come out of the right
shift register.
If the width of the array isn't fixed, use an initialize array instead.
Greg McKaskle