convert patch ojbect to alphashape in matlab

main.m
% Convert patch object to AlphaShape in MATLAB

% Create patch object
[xx,yy] = meshgrid(-10:0.1:10,-10:0.1:10);
zz = peaks(xx,yy);
figure;
surf(xx,yy,zz)
axis([-10 10 -10 10 -10 10])

% Get the vertices and faces of the patch object
vertices = [reshape(xx,[],1), reshape(yy,[],1), reshape(zz,[],1)];
faces = delaunay(xx,yy);

% Create AlphaShape from vertices and faces
alphaShape = alphaShape(vertices, faces);

% Plot the resulting alpha shape
figure;
plot(alphaShape)
472 chars
20 lines

gistlibby LogSnag