%% Smooth Isosurface Data
% Create a 10-by-10-by-10 array of random data and smooth it.

data = rand(10,10,10);
data = smooth3(data,'box',5);

%
% Display the data as an isosurface with end caps.

patch(isocaps(data,.5),...
   'FaceColor','interp','EdgeColor','none');
p1 = patch(isosurface(data,.5),...
   'FaceColor','blue','EdgeColor','none');
isonormals(data,p1);
view(3); 
axis vis3d tight
camlight left
lighting gouraud

% Copyright 2020 The MathWorks, Inc.