11-13-2019 04:52 AM
hello everyone:
I have complex 1D array of length(3000) and I want to insert another 1D array of length (1200) into the first one starting at index (500) of the first array the output array should with a length (3000) , the problem is that the resulting array with length(4200) not (3000) ?!
Solved! Go to Solution.
11-13-2019 05:21 AM
Hi ashly,
@ASHLY19 wrote:
I have complex 1D array of length(3000) and I want to insert another 1D array of length (1200) into the first one starting at index (500) of the first array the output array should with a length (3000) , the problem is that the resulting array with length(4200) not (3000) ?!
Why is it a problem when the resulting array contains 4200 elements - after you inserted 1200 elements into your 3000 elements array?
Do you want to insert new elements or do you want to replace elements?
Two options to get a resulting array of 3000 elements:
11-13-2019 05:21 AM
11-13-2019 06:10 AM
I want the two arrays overlapped not concatenated as shown the following figures
11-13-2019 06:25 AM
As GerdW mentioned, it sounds like what you want to do is replace array elements, not insert into array. Replace array elements will write the elements from the smaller array over the elements of the larger array.
11-13-2019 06:29 AM
The Add simply creates an output of the smallest input size.
The "Insert Into Array" inserts into an array (yes, really 😉).
It's not clear how exactly you want this 'overlap' to happen? Is the Add an attempt, just a test or the requirement?
If you want to add the two arrays, first make sure they are the same size. If addition is the goal, grow the smallest array to the size of the larger one (either calculate the sizes and concatenate the missing data, or use Resize Array), then use Add.