- /
-
Changing logo
on 17 Nov 2023
- 7
- 18
- 1
- 0
- 795
drawframe(1);
Write your drawframe function below
function drawframe(f)
% Get membrane data for MATLAB logo and create axes
Z = 160*membrane(1,100);
ax = axes;
% Create surf plot of MATLAB logo
s = surf(Z,'EdgeColor','none');
set(ax,'XLim',[-101 301],...
'YLim',[-101 301],...
'ZLim',[-153.4 260],...
'CameraPosition',[-145.5 -229.7 283.6],...
'CameraTarget',[77.4 60.2 63.9],...
'CameraUpVector',[0 0 1],...
'CameraViewAngle',36.7,...
'Position',[0 0 1 1],...
'DataAspectRatio',[1 1 .9]);
% Choose light properties
l1 = light;
set(l1,'Position',[160 400 80],...
'Style','local',...
'Color',[0 0.8 0.8]);
% Choose light properties
l2 = light;
set(l2,'Position',[.5 -1 .4],...
'Color',[0.8 0.8 0]);
% Set properties of the surf plot
if f<=24
s.FaceColor = (f/24)*[0.9 0.2 0.2];
else
s.FaceColor = (1-((f-24)/24))*[0.9 0.2 0.2];
end
set(s,'FaceLighting','gouraud',...
'AmbientStrength',0.3,...
'DiffuseStrength',0.6,...
'BackFaceLighting','lit',...
'SpecularStrength',1,...
'SpecularColorReflectance',1,...
'SpecularExponent',7);
% Change axis properties
set(gca,'XTick',[],'YTick',[],'ZTick',[],'Color','k');
end