Solution
A row or a column of a 2D array is also a 1D array. In LabVIEW you can use the
Add Array Elements function from the Numeric Palette to calculate the sum of a 1D array. Use this function in a
For Loop and connect the input array and also the output array with
Auto-Indexed Tunnels.
- If you need to calculate the sum of the rows you need to connect the array to the For Loop directly:
Note: This image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project. To use a snippet, right-click the image, save it to your computer, and drag the file onto your LabVIEW diagram.
- If you need to calculate the sum of the columns you need to connect the array to the For Loop through the Transpose 2D Array function:
Note: This image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project. To use a snippet, right-click the image, save it to your computer, and drag the file onto your LabVIEW diagram.