LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

does any body know how to replace a chunk of elements in a 2-D array

I have a vi that I am working on that needs to be able to replace a lot of elements and I would like to replace them all with 1 operation. thanks in advance vivi
0 Kudos
Message 1 of 9
(2,937 Views)
You have replace array subset function that you can use.
If you want to replace at différent index, you could just expand the icon and more input will be avalaible.
Benoit
Benoit Séguin
Software Designer
0 Kudos
Message 2 of 9
(2,932 Views)
I tried that but the problem is that I need to replace indexes 3-100 in the x direction and 17-210 in the y direction just to give it some numbers
0 Kudos
Message 3 of 9
(2,922 Views)
You dont have the choice to use an For loop or a while loop
Sorry you have to work... Nothing is free.
 
lol
 
 
Benoit
Benoit Séguin
Software Designer
0 Kudos
Message 4 of 9
(2,922 Views)
Thanks anyway Benoit
0 Kudos
Message 5 of 9
(2,920 Views)
I you want to replace a "rectangle" inside a 2D array, you can wire a 2D array into the element input of the Replace Array Subset. In that case, the index you wire into the function will specify where you start the replacing.

___________________
Try to take over the world!
Message 6 of 9
(2,912 Views)
how do you tell the function where to stop replacing the elements
0 Kudos
Message 7 of 9
(2,908 Views)
It's use exactly the sise of your new array
Benoit
Benoit Séguin
Software Designer
0 Kudos
Message 8 of 9
(2,906 Views)
You can use Replace Array Subset.  Just wire 17 to the row input, 3 to the column input, and a 2D array to the new element/subarray input.  This will replace all of the rows and columns with the new array.  If you meant you just wanted to replace that one row and one column, wire a 1D array to the input and tell it the position to start.
0 Kudos
Message 9 of 9
(2,903 Views)