LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Make a basic operation row by row 2D Array

Hello everyone, 

 

So today i come up with a new problem, i want to make a basic operation with the first row of my 2D array (an addition for example), then i want to do the same operation with the 2nd row of my array and so on. I use a stacked sequence so i can extract the 1st row and then make an addition of these 2 numbers, so the problem here is obvious, my stacked sequence will wait until the first frame is finished then it will do the operation.

 

So if you have any ideas that would be great.

 

You can see my VI down below.

 

Thenks. Luis.

0 Kudos
Message 1 of 2
(1,884 Views)

Make a (for) loop to get the row, do the operation in the loop. You can use auto indexing.

 

Instead of getting all the rows in a loop, then do an operation on the last result.

 

No need for a stacked sequence structure (there never is). No need for locals. No need for a shift register (the value is 'i').

calculation on rows.PNG

 

Alternatively, get the 1st column, and the 2nd column and add the two resulting arrays. That gives the same result, without the loop:

calculation on columns.PNG

0 Kudos
Message 2 of 2
(1,858 Views)