필터 지우기
필터 지우기

How to know if a Point belongs to a curve?

조회 수: 2 (최근 30일)
ErikJon Pérez Mardaras
ErikJon Pérez Mardaras 2020년 11월 23일
댓글: David Hill 2020년 11월 25일
I have a point P given by its coordinates like this:
P=[xp;yp];
And I have the function curve, which is a 2x900 matrix that has its coordinates:
curve=[x0 x1 x2 x3 x4 x5 x6 x7 x8;y0 y1 y2 y3 y4 y5 y6 y7 y8];
(each element in this matrix has 100 elements inside)
I would like to know if P belongs to the curve. Is there any way of knowing it?

답변 (1개)

David Hill
David Hill 2020년 11월 23일
ismember(curve',P','rows');
  댓글 수: 2
ErikJon Pérez Mardaras
ErikJon Pérez Mardaras 2020년 11월 24일
It says me that both A and B must have the same number of columns. Which doesn't make a lot of sense...because P is a 2x1 matrix and curve is a 2x900 matrix.
David Hill
David Hill 2020년 11월 25일
Make sure you transpose (curve') and (P').

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by