05-21-2019 04:10 AM
Hi
I have a 2D array and a 1D array as shown in the figure below. I need to replace zeros in the 2D array with NaN depending on the values in the 1D array.
For example since the first element in the 1D array is one, I need to keep the first element in the first row of 2D array and make the remaining zeros in the row as NaN.
Similarly the last row of the 1D array is three. So the zero in the last row of the 2D array remains as zero.
Any help to sort this out is highly appreciated.
Thanks
05-21-2019 05:07 AM
Use the auto indexing feature of For loop to get the row of 2D array and element of 1d array then you can try manipulating array element using node "Replace Subset array".