LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Initialize already existing 2d array

Hello all,

 

I am making a subVI which inserts an element into a specific column and row.

 

What I would like to know is how to initialise an already existing 2D array

 

I have tried the reshape array function, and initialising my array to whatever the column and row I would like to insert into is, incredmented by 1.

Enough this seems to initialise the array, it also moves what is already in the array.

 

 

0 Kudos
Message 1 of 4
(4,823 Views)

Use the initialise array function to create the array of the correct size with the data you want (e.g. an empty string - if you need to initialise it with different values then use for loops) and then use replace array subset to fill in the array.

 

2015-07-02_11-46-08.png


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 2 of 4
(4,807 Views)

Thanks for your reply Sam,

 

Is it possible to initialise more cells to an already existing 2D array, because what I'm trying to do is insert a value outside of the initialised area

0 Kudos
Message 3 of 4
(4,725 Views)

Initialize the array at the final size (as shown), use replace array subset to insert the original array at position 0,0, then replace the new element as already shown.

 

("reshape array" is NOT the correct function for this, because it keeps the original array elements in memory order and thus rearrange things quite a bit)

 

 

0 Kudos
Message 4 of 4
(4,718 Views)