LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Please help , insert 1d array into 2d array

Solved!
Go to solution

Hi

I'm trying to insert a row of 1d array into 2d array but it has to be placed at the desired index as the starting point.

For example,  row 1 , column 2. = starting point.

I already wrote the program but the result is not that i want.
As shown in the picture, a number 6 in (0,2) , it should be placed in a yellow highlight.  

Please help and guide me.

example.jpg

0 Kudos
Message 1 of 5
(5,059 Views)

example.jpg

0 Kudos
Message 2 of 5
(5,045 Views)
Solution
Accepted by fattynoon

Hi fatty,

 

use shift registers:

check.png

It's maybe a good idea to include some range checking as it's not possible to replace non-existing elements...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 5
(5,038 Views)

Many thanks GerdW Smiley Happy

So, it's mean that I have to replace an element at a time right?

Can I replace an entire row at a time? 

0 Kudos
Message 4 of 5
(5,028 Views)

Hi fatty,

 

yes, you can replace a complete row - when you only wire the "row"! input of ReplaceArraySubset. But you wanted to replace only some elements of a complete row...

 

Otherwise that operation would be not properly defined: in a 2D-array you can replace rows and columns. When you wire both row and column index, you have no option to define "replace row" or "replace column"...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 5
(5,025 Views)