get the x-value of a point on curve
이전 댓글 표시
I draw a curve between two vector of points, not a function, how can I get the x-value of a certain y-value of the curve?
채택된 답변
추가 답변 (1개)
Sky Sartorius
2020년 2월 20일
This is a table lookup / interpolation problem. For your data, you'll first have to make sure there aren't any repeated y values.
yQuery = -2.6e8; % Example query point.
[Y,ind] = unique(y,'stable')
X = x(ind);
x = interp1(Y,X,yQuery)
댓글 수: 2
ahmed salah
2020년 2월 20일
the cyclist
2020년 2월 20일
The best way to thank a contributor is to upvote and/or accept their answer. This rewards them with reputation points, and also directs future users to solutions.
카테고리
도움말 센터 및 File Exchange에서 Geographic Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!