
simple loop in a wave

carlosgarzonc
i need to create a loop that goes to every point in a wave and compares every value of the wave to a threshold. my output should be how many data points of that wave go over that threshold.
example
threshold = 7
wave1
1
2
3
4
5
6
7
8
9
output = 2 // because 8 and 9 are over the threshold that is 7.
thanks,
carlos
print this in the history:
w[0]= {2}
You could also do this:
and wrapping it in a function in Igor 6.2 allows you to use a free wave for the intermediate, eliminating the clutter:
My suspicion (without any testing) is that the matrixOP solution would be fastest if the input is very large.
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
August 17, 2010 at 08:50 am - Permalink
To learn about Igor Programming, execute this:
August 17, 2010 at 09:26 am - Permalink
or as a function:
August 17, 2010 at 09:52 pm - Permalink