Connecting the threshold points of a curve using straight lines
1 次查看(过去 30 天)
显示 更早的评论
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/163674/image.jpeg)
I want to connect the threshold point of energy using matlab programatically. I am unable to understand what is the best way to do it. Keeping in mind that at the end i will require only straight lines so need the data point for the lines fitting the curve. Any idea how can this be done?
2 个评论
Rik
2017-5-2
Are the straight lines known, or should they be generate from the curve?
If the first is the case, it is just a matter of finding the intersection coordinates of two straight lines, which should take you 5 minutes to Google.
If the latter is the case, I think I would try an iterative approach: use polyfit for more and more points, until a threshold is reached for a GOF-parameter, then start selecting points for the next line segment.
回答(1 个)
Image Analyst
2017-5-2
Assuming you don't know exactly where the tangent lines should fall, I think this is a case of finding the "minimum perimeter polygon". See http://dip.sun.ac.za/~hanno/tw444/lesings/lesing_19.pdf for a lesson on it.
3 个评论
Image Analyst
2017-5-2
Knowing the data points, and the fact that there are lines in between them, you can use linspace() or interp1() to get a bunch of points in between.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Biotech and Pharmaceutical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!