07-06-2020 01:50 PM
Hello, I have a waveform graph that looks like below. Each bin is 5 ns and the total counts are the sum of y values for the whole x range. I wonder how to sum the y counts for an x range, such as 100-300 ns. My thought is to make a for loop to add the y value for every single x in the range of 100-300 (Not sure). If it is a curve, I may do the integral for x=100-300. Thank you
Solved! Go to Solution.
07-06-2020 02:24 PM
Hi beyond,
@beyonddd wrote:
I wonder how to sum the y counts for an x range, such as 100-300 ns. My thought is to make a for loop to add the y value for every single x in the range of 100-300 (Not sure).
The data should be provided in an array, so all you need is an ArraySubset function followed by SumArray…
07-06-2020 03:09 PM
Got it. Thanks a lot, GerdW. I will extract the data as an array and try it.
07-09-2020 12:19 PM
If it's a graph, you're providing an array as an input. That's the data that's being represented by the graph.
Just take the subset of the array you're interested in.
07-11-2020 10:33 PM
Thank you, I have figured it out.