calculate the length of scattered data

3 visualizaciones (últimos 30 días)
yunwei hu
yunwei hu el 10 de Feb. de 2020
Comentada: KSSV el 10 de Feb. de 2020
Hello everyone,
contour.jpg
can anyone tell me how to calculate the length of the curve l plotted here?
thanks in advance!

Respuesta aceptada

KSSV
KSSV el 10 de Feb. de 2020
Editada: KSSV el 10 de Feb. de 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 comentarios
yunwei hu
yunwei hu el 10 de Feb. de 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 el 10 de Feb. de 2020
If plot(x,y), give you the above curve..you can use what I have given.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Scatter Plots en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by