Removing repeating values from waves
Is there a clean way to remove repeating values from waves? I have waves that sometimes have duplicates or triplicates of a number and I would like to keep only one instance. I have looked in the forum and manual but I haven't spotted anything like a function that may help in doing this. I was thinking of sorting and creating two lists to move numbers from one to the other after parsing through but any ideas are appreciated.
Maybe this could serve as a first idea (result is sorted):
Beware of floats !
HJ
August 22, 2017 at 03:00 pm - Permalink
A.G.
WaveMetrics, Inc.
August 22, 2017 at 03:41 pm - Permalink
August 22, 2017 at 06:09 pm - Permalink
Invoke it like: , where is your wave, is the number you want to zap.
best,
_sk
August 23, 2017 at 01:17 am - Permalink
The code is limited to Integer values and you would have to loop over a list of integers which you want to remove.
If you just wanted to remove a specific value from a wave it is simpler to execute:
Note that in this example specificValue is any real-value and strict equality is required, something that FindDuplicates handles via the Tolerance flag.
A.G.
August 23, 2017 at 10:59 am - Permalink
This will also remove the first instance of the duplicate integer, which I interpreted as a requirement of the poster. If this isn't the case, then, indeed, there is no need for looping through the indeces of the duplicate integer.
best,
_sk
August 23, 2017 at 12:41 pm - Permalink
You are absolutely right. It will remove all instances.
August 23, 2017 at 05:51 pm - Permalink