|
⇤ ← Revision 1 as of 2025-12-17 19:15:36
Size: 720
Comment: Initial commit
|
← Revision 2 as of 2025-12-17 19:23:23 ⇥
Size: 720
Comment: Change title
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 1: | Line 1: |
| = MATLAB ConvHull = | = MATLAB convhull = |
MATLAB convhull
The convhull function calculates the indices of the convex hull encapsulating a set.
Contents
Usage
% Create a rectangular grid. [X,Y,Z] = meshgrid(linspace(-3,3,20), linspace(-3,3,20), linspace(-3,3,20)); % Identify the points within a region of integration. roi = (X>=0 & X<=sqrt(4-Z.^2-Y.^2)) & (Y>=0 & Y<=sqrt(4-Z.^2) & (Z>=0 & Z<=1)); % Calculate the convex hull of this ROI. K = convhull(X(roi), Y(roi), Z(roi));
K is now a 3-column matrix representing the indices that form the hull. This can be used with trisurf like:
trisurf(K, X(roi), Y(roi), Z(roi));
