calculate the length of scattered data

1 回表示 (過去 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 Center および File ExchangeScatter Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by