Creating equidistant point on a 2D boundary plot
12 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Lorenzo Pollicini
am 25 Okt. 2023
Kommentiert: Lorenzo Pollicini
am 25 Okt. 2023
Dear All,
I have a 1953x3 matrix projPoint containing the X and Y coordinates of some points. I was able to obtain the contour of the figure by using the boundary function:
K = boundary(projPoint(:,1), projPoint(:,2));
plot(projPoint(K2,1), projPoint(K2,2), 'b');
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1520931/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1520936/image.jpeg)
I would like to create points at a equidistant distance (XY modulus = 2) following the boundary line, so that I all the new points created on the 2D line are at a equidistant distance.
I have tried to use interp function as shown:
xq= min(projPoint):2:max(projPoint);
yq = interp1(projPoint(:,1),projPoint(:,2),xq);
but I get the error:
Error using matlab.internal.math.interp1
Sample points must be unique.
Error in interp1 (line 188)
VqLite = matlab.internal.math.interp1(X,V,method,method,Xqcol);
Thank you in advance for the support,
Lorenzo
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Surface and Mesh Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!