calculate the length of scattered data

2 vues (au cours des 30 derniers jours)
yunwei hu
yunwei hu le 10 Fév 2020
Commenté : KSSV le 10 Fév 2020
Hello everyone,
contour.jpg
can anyone tell me how to calculate the length of the curve l plotted here?
thanks in advance!

Réponse acceptée

KSSV
KSSV le 10 Fév 2020
Modifié(e) : KSSV le 10 Fév 2020
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 commentaires
yunwei hu
yunwei hu le 10 Fév 2020
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 le 10 Fév 2020
If plot(x,y), give you the above curve..you can use what I have given.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Scatter Plots dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by