MATLAB patch

The patch function creates a 3D graphic.


Usage

As an alternative to trisurf, consider:

% 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 and plot.
K = convhulln([X(roi), Y(roi), Z(roi)]);
figure;
patch('Faces', K, 'Vertices', [X(roi), Y(roi), Z(roi)]);


CategoryRicottone

MATLAB/Patch (last edited 2025-12-17 20:41:58 by DominicRicottone)