WaveMax difference for in-line call
Dave_S
I'm normalizing some waves to the maximum value within that wave.
The behavior I see is that using the WaveMax function within a wave assignment statement yields different results than storing the max value in a variable and then reassigning the wave.
In code:
Make /O/N=1024 Line1 = 5; Line1[600, 750]=35e3; Duplicate /O Line1 Line2; Variable Line1_Max = WaveMax(line1); Line1 /= Line1_Max; Line2 /= Wavemax(Line2)
Display Line1, Line2; ModifyGraph rgb(Line2)=(0,0,65535)
The 2 lines are different after some point.
I've attached an experiment containing the actual data I'm analyzing.
Thanks for your help,
Dave
evaluates sequentially WaveMax() for each point in the wave Line2 and as elements of the wave are divided, the value returned by WaveMax() also changes.
You should consider using:
Line2/=nor
Alternatively:
August 30, 2013 at 02:38 pm - Permalink
Thanks for the clarification!
August 31, 2013 at 11:13 am - Permalink
FYI, the result you see has nothing to do with the internals of WaveMax(). If you had used any other function or mathematical operation that, on the right hand side, uses the same wave you are assigning values to, you would have seen something similar.
September 2, 2013 at 06:53 am - Permalink