calculate the length of scattered data

3 次查看(过去 30 天)
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