This script programmatically calculates the average slope between two defined channel values, which may be useful for e.g. determining the Youngs Modulus using Hookes Law. Tensile Test (the slope of the linear range is called "Youngs Modulus")
We iterate through the channel until a measurement exceeds a start value (e.g. y = 2). We then store this pair of numbers as [x0,y0].
From hereon, we iterate through the channel until the stop value has been reached (e.g. y = 17). We also store this pair of number as [x1,y1].
Finally, we calculate the slope which is defined as slope = (y1 - y0) / (x1 - x0).
As a bonus, we check if the start and stop value have ever been reached. If not, an error message is returned.