%% Specify Light Direction and Reflectance for Surface Plot
% Create three matrices of the same size to plot as a surface. Specify the direction of the light source to have an azimuth of 45 degrees and an elevation of 20 degrees. Increase the reflectance of the surface by increasing the contribution of ambient light and decreasing the contibutions of diffused and specular reflection. Assign the surface object to the variable sl.

[X,Y] = meshgrid(1:0.5:10,1:20);
Z = sin(X) + cos(Y);
s = [-45 20];
k = [.65 .4 .3 10];

%
% Plot the data using the source and reflectance vectors.

sl = surfl(X,Y,Z,s,k);

%
% Use sl to access and modify properties of the surface object after it is created. For example, hide the edges by setting the EdgeColor property.

sl.EdgeColor = 'none';

% Copyright 2019 The MathWorks, Inc.