05-16-2022 09:23 AM
I have an 2d array of about 100000 sorted elements in the first index, I need to derive the subarray whose values are included between a lower and upper bounds (not the array index, but the value contained in them). The element-by-element comparison is too slow. How can I do?
Solved! Go to Solution.
05-16-2022 09:33 AM
If the limits exist in the array you can use "Search ordered array" (or Search 1D array) for them and then use those indeces with a Array Subset. If the limits are arbitrary you'll need to use Threshold array.
05-16-2022 09:53 AM
thanks!
05-16-2022 11:56 AM
"Threshold 1D array " can efficiently search a nondescending array and you can round up or down to the next integer to either include or exclude the boundaries. I would recommend that instead.
(for the second limit you can even change the start index).
05-16-2022 12:20 PM - edited 05-16-2022 12:28 PM
@altenbach wrote:
"Threshold 1D array " can efficiently search a nondescending array
Here's what I had in mind: