LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

"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."


Appreciate the sample VI's but I can't open them ( I have Labview 5.01 )
0 Kudos
Message 1 of 4
(2,818 Views)
Here is Mikael solution, expanded to include rows and ready to use as a subVI. Now all is needed is the polymorphic version 🙂
www.vartortech.com
0 Kudos
Message 3 of 4
(2,818 Views)
Wire your array into a FOR LOOP (indexing enabled). Inside the FOR LOOP,
wire the indexed 1D array to the ADD ARRAY ELEMENTS function and then wire
the sum out the FOR LOOP (indexing enabled). Thats it!

Tom Whitaker

"Big K" wrote in message
news:50650000000800000034360000-1007855737000@exchange.ni.com...
> "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."
>
>
>
Appreciate the sample VI's but I can't open them ( I have Labview 5.01
> )
0 Kudos
Message 4 of 4
(2,818 Views)