![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/332264/image.png)
Outer Bounds of a Dataset
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Saeid
am 15 Jul. 2020
Kommentiert: Saeid
am 16 Jul. 2020
I have a set of xy data and I want to find the outer bounds of this set so that when I plot the data and connect these outer bound points, all ther other points will be confined to these boundaries, as shown if figure.
How can I do that?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/332261/image.png)
0 Kommentare
Akzeptierte Antwort
Image Analyst
am 15 Jul. 2020
You can try boundary(). There is a shrink factor input to determine how closely the boundary "hugs" the point set. The shrink factor is a scalar between 0 and 1. Setting s to 0 gives the convex hull, and setting s to 1 gives a compact boundary that envelops the points. The default shrink factor is 0.5.
x = gallery('uniformdata',30,1,1);
y = gallery('uniformdata',30,1,10);
plot(x,y,'.')
xlim([-0.2 1.2])
ylim([-0.2 1.2])
k = boundary(x,y);
hold on;
plot(x(k),y(k));
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/332264/image.png)
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Polynomials 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!