I often want to pull elements out of an array based on their content. In a simple example, I'd like an array B that contains all, the elements of A that are greater than 0.5. A few previous posts have suggested a conditional append function on the output of a loop. Here's another possibility. Change IndexArray so that one can wire an array of Booleans to the Index input. The output would be just those elements of the input array for which the Boolean array element is true.
Another way to handle this would be to have a primitive that returns an integer array containing the indices of the true elements in a boolean array. Then allow arrays of indices to be wired to the Index input of IndexArray.
By the way, these are not really orignal ideas. They come from Matlab. Specifically, the A(A>0.5) syntax and find(A>0.5).