Equally spaced points along a nonlinear path
Mostrar comentarios más antiguos
I have a path linear by parts that I need to equally divide with points. How do I do that?
Respuesta aceptada
Más respuestas (1)
John D'Errico
el 27 de Mayo de 2024
Editada: John D'Errico
el 27 de Mayo de 2024
Simpler yet, just download my interparc from the file exchange. It allows you to do the operation in a variety of ways, using several variations of spline interpolant, or assuming piecewise linear segments.
It does all the work for you, and it is free.
x = randn(6,1);
y = randn(6,1);
% 500 points, equally spaced along the curve in arclength
Pspline = interparc(500,x,y,'spline');
plot(x,y,'ro',Pspline(:,1),Pspline(:,2),'-')

Categorías
Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!