フィルターのクリア

Is there a way to get the intersection point between two curves in Matlab?

32 ビュー (過去 30 日間)
Domenico Dicugno
Domenico Dicugno 2015 年 6 月 18 日
回答済み: somya bhatnagar 2020 年 12 月 25 日
Dear All,
from a contour I get returned the point relative to two iso-curves on a x-y plane. Then, I try to get the intersection point between these two curves. If they behave as a function, then I use the interp1 to find this point. However, in general, it happens that the curves are not functions and this solution no longer works. I tried to use spline but I got a similar problem since the error message looks like:
Error using chckxy (line 51)
The data sites should be distinct.
Error in spline (line 53) [x,y,sizey,endslopes] = chckxy(x,y);
Do you have any suggestions on how to solve this problem?
Many thanks in advance.

回答 (2 件)

Luffy
Luffy 2015 年 6 月 18 日
If you have the equation to two curves,you can find the point manually: if y1 & y2 are their equations:
idx = find(y1 - y2 < eps, 1); %// Index of coordinate in array
px = x(idx);
py = y1(idx);
plot(px,py,'or','MarkerSize',18);
If not take a look at this: Curve intersections

somya bhatnagar
somya bhatnagar 2020 年 12 月 25 日
if the values intersection point to be found lies in a polynomial then you can use
[xi,yi]=polyxpoly(x1,y1,x2,y2);

カテゴリ

Help Center および File ExchangeSplines についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by