%% True Color Data
% This example displays an isosurface and colors it with true color (RGB) data.

[x,y,z] = meshgrid(1:20,1:20,1:20);
data = sqrt(x.^2 + y.^2 + z.^2);
p = patch(isosurface(x,y,z,data,20));
isonormals(x,y,z,data,p)
[r,g,b] = meshgrid(20:-1:1,1:20,1:20);
isocolors(x,y,z,r/20,g/20,b/20,p)
p.FaceColor = 'interp';
p.EdgeColor = 'none';
view(150,30) 
daspect([1 1 1])
camlight 
lighting gouraud

% Copyright 2015 The MathWorks, Inc.