%% Calculate Patch Data Using Surface Object
% Calculate face, vertex, and color data from a surface whose handle has
% been passed as an argument.

% Copyright 2015 The MathWorks, Inc.


figure
s = surf(peaks);
patch(surf2patch(s));
delete(s)
shading faceted; 
view(3)