01-09-2019 06:50 PM
I am making a find function to mimic the usage of MATLAB's find function.
It's usage is [V I] = find(array<value, 4); where the find function finds values using the logic comparison to a value and returns the number of nearest values as specified. The indexes for the values are also returned. I am having an issue when duplicates exist. I would like the duplicates to be in order of how they appeared in the original array. but I need to separate out all duplicates, sort them then put them back with the rest. Any idea's on how to remove all duplicates?
Thanks,
Solved! Go to Solution.
01-09-2019 08:51 PM
I found the solution. Duplicates for values less than zero need to be joined with the original index's, then sorted by the original index's, then sorted by the values, then reversed.
01-10-2019 03:15 AM
Some unsolicited advice:
I'd replace the "If A then false else !B" with a Greater or equal to 0.
Or, if you're really worried about the performance impact of a third float compare, replace the "If A then false else !B" with "A nand B"...