LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

updating part of a column in a 2d array

I need to update part of a column of a 2d array within a while loop. 

For example, say I have a 1000 x 4 array (Initialized outside the loop), and at each iteration of a loop I need to update the subsequent 100 elements in column 4. So the column would fill up after 10 iterations. I tried to to do this with replace array subset and insert into array, where I would try to index the column as 4 and the row number as the next 100th (according to the current iteraiton of the loop) but I am either not able to connect the data wires or get an error saying that I need to enter only 1 element. 

what is the way to enter part of a column in an array, while providing the starting location?

 

Thank you

 

Aditi

 

 

0 Kudos
Message 1 of 3
(3,169 Views)

Since you want to keep the 2D array the same size, "insert into array" is definitely the wrong choice.

 

This leaves "replace array subset". If you specify both indices, the insertee also needs to be 2D, so you simply need to convert your 1D array into 2D (using built array of height=1, transpose if needed) and insert it at the desired location.

 

 

0 Kudos
Message 2 of 3
(3,157 Views)

Here's a quick illustration:

 

 

Message 3 of 3
(3,147 Views)