calculate the length of scattered data

조회 수: 2 (최근 30일)
yunwei hu
yunwei hu 2020년 2월 10일
댓글: KSSV 2020년 2월 10일
Hello everyone,
contour.jpg
can anyone tell me how to calculate the length of the curve l plotted here?
thanks in advance!

채택된 답변

KSSV
KSSV 2020년 2월 10일
편집: KSSV 2020년 2월 10일
Let A be your n*2 data points
A = [A ; A(1,:)] ;
x = A(:,1) ; % x coordinates of the points
y = A(:,2) ; % y coordinates of the points
iwant = sum(sqrt(diff(x).^2+diff(y).^2)) ; % distance formula
  댓글 수: 4
yunwei hu
yunwei hu 2020년 2월 10일
Sorry l did not explain clearly before.
Actually this is the contour of a cell and i would need the length of it. That is why the curve is closed.
KSSV
KSSV 2020년 2월 10일
If plot(x,y), give you the above curve..you can use what I have given.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Scatter Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by