08-26-2014 02:58 AM
Hi,
I have a 2D array with alot of information and only want to replace some data at a specific point... see image:
When i use replace subset i can only replace one element at a specific row and column...
Best regards,
Thijs Boeree
Solved! Go to Solution.
08-26-2014 03:05 AM
@ThijsBoeree wrote:
When i use replace subset i can only replace one element at a specific row and column...
So, use a loop. 😄
08-26-2014 03:22 AM
I think i allready got it... Without a loop!!
I use index array on the 2D array then i use replace array subset on the 1D array, here you can give an index and replace the 2D array again with the newly formed 1D array!
08-26-2014 03:33 AM
08-26-2014 09:48 AM - edited 08-26-2014 10:42 AM
The correct solution is to change the small 1D array to a 2D array and use "replace array subset" with both indices wired.
It requires a 2D array such that the function know if it needs to replace going down or going right from the given index. It cannot deal with a 1D array directly, because the operation would be ambiguous.
08-26-2014 09:57 AM - edited 08-27-2014 02:00 AM
@altenbach wrote:
The correct solution is to change the small 1D array to a 2D array and use "replace array subset" with both indices wired.
Here's what I had in mind.
(If you want to replace down the column instead, simply add a transpose after the build array node.)
08-26-2014 10:01 AM - edited 08-26-2014 10:02 AM
@altenbach wrote:
(If you want to replace down the column instead, simply add a transpose after the build array node.)
08-27-2014 01:24 AM
Wow that's a much nicer approach!
Best regards,
Thijs