How to get the max value of an x-wave on the top graph?
That_guy91
I'm currently writing a formatting function that I can use on a specific type of data set. I am basically formatting the top graph in a specific way. I have run into a snag however and know what I need to fix it, but am not sure what code snippet I need.
How can you extract the maximum value of an x-wave from the top graph? The data I am working with is in the time domain and I effectively want to pull out the last time point from the graph to use in the function I am writing.
Thank you.
Hi,
I going to make some simplifying assumptions in that you know the name of the Y wave and the graphName, though you can use "" for the top graph.
Look at the function:
XWaveRefFromTrace(graphNameStr, traceNameStr )
The XWaveRefFromTrace function returns a wave reference to the wave supplying the X coordinates against which the named trace is displayed in the named graph window or subwindow.
Since it returns a wave reference, you can use that in the WaveMax function
WaveMax(waveName [, x1, x2 ])
The WaveMax function returns the maximum value in the wave for points between x=x1 to x=x2, inclusive.
So combining TheMaxYouSeek = WaveMax(XWaveRefFromTrace(graphNameStr, traceNameStr ))
Andy
August 16, 2019 at 09:48 am - Permalink