Finding x value for given y in a zig-zag data.
2 次查看(过去 30 天)
显示 更早的评论
I have a data which oscillates around x-axis. How can I get x values for a given y value. I can get as many, I will sort the one required.
Thank you.
0 个评论
采纳的回答
Star Strider
2020-8-29
Use findpeaks (with the original and negative of your data), or islocalmax and islocalmin, to get the peaks and valleys, then for each of those segments, use interp1 to get the x-values for a y-value in each segment.
This obviously requires a loop. There is no alternative.
0 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!