I would like to have a function "range(waveName [, x1,x2])" that emulates the mean function, but would return the difference between the highest and lowest values in the specified set.
I was embedding the function into a routine found in the manual "Finding the Mean of Segments of a Wave," using "range" instead of "mean."
It ended up that working with the WaveMax and WaveMin valuations was the easier way to go. I tried to create a value "y_range" separately, but it wasn't taking for whatever reason. Anyway, I got what I needed.
Wave inWave
Variable x1, x2
WaveStats/M=1/Q/R=(x1,x2) inWave
return V_max-V_min
End
July 30, 2010 at 03:07 pm - Permalink
Wave w
Variable x1, x2
Variable wMin = WaveMin(w, x1, x2)
Variable wMax = WaveMax(w, x1, x2)
Variable dif = wMax - wMin
return dif
End
I'm not sure which would be faster (and I'm not willing to bet a nickel on it!).
July 30, 2010 at 06:00 pm - Permalink
I was embedding the function into a routine found in the manual "Finding the Mean of Segments of a Wave," using "range" instead of "mean."
It ended up that working with the WaveMax and WaveMin valuations was the easier way to go. I tried to create a value "y_range" separately, but it wasn't taking for whatever reason. Anyway, I got what I needed.
August 3, 2010 at 06:07 am - Permalink