08-30-2016 12:35 PM - edited 08-30-2016 12:36 PM
Hello, I want to know how can I specify the position of y=0
I use cursor ,then key 0 in the right side blank, and it shows the first point of y= 0 of the curve
However I only want to know the other point (position of y=0 in the wave)
How can I do with the cursor function?
And actually I also hope that I can get the value immediately after I get this curve , Is there any way to set this condition?
I'll appreciate any of advice.
08-30-2016 01:14 PM
If I understand your question correctly, you are looking for zero crossings, or sign changes in your data?
I don't think there is an easy way to do this using the cursor functions, but you can use the "sign" function inside a for loop with your data.
08-30-2016 02:10 PM
I want to specify the inflection point, and the curve in picture "test" is the second derivative of the original fitting curve.
sorry I don't understand your advice.....I'm just a beginner......
Could I get the inflection point through this way?
08-30-2016 03:59 PM
Yes that's exactly what this code does, but you should convince yourself of that. You can turn on highlight execution "lightbulb" and see what is happening everytime the loop runs.
Do not use dynamic data (big dark blue wires) it hides and confuses what is going on. Input your actual data, the array of dbl that contains your y" (second derivative) values where I have labeled "sample data". It is just a sine wave right now. In output array you will get the indices of the zero crossings.
If you have X data too, then to go from indices to real values you use "index array" inside a for loop. Have it use the entire X data, but auto-index on the indices (as shown below).
Of course you don't need 2 for loops, you could do it all in one. But I think finding the indices is more modular (I would put it in a SubVI), and it is how many of the built in array functions are designed, so it is consistent. But if you want it all in one loop it should be faster: