In his honor, here is Matlab code to generate a Mandlebrot set (from an old homework assignment):<p>function inValues= mndl(limits) %no inputs needed, used by the script to zoom in<p>%amount of detail to calculate; larger number = better resolution, slower calculation
stepsR=300;
stepsI=300;<p>%maximum iterations used in calculations
maxIter=50;<p>if exist('limits')~=1; %intial range of real and imaginary numbers to compute
lowerR=-2;
lowerI=-1.25;
higherR=1;
higherI=1.25;
else numel(limits)==4; %range to compute after zooming in, determined by axis
lowerR=limits(1);
lowerI=limits(3);
higherR=limits(2);
higherI=limits(4);
end<p>%Constants:
slR=(higherR-lowerR)/(stepsR-1);
slI=(higherI-lowerI)/(stepsI-1);<p>%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Create the Mandelbrot image.<p>[x,y]=meshgrid([0:stepsR-1]<i>slR+lowerR,[0:stepsI-1]</i>slI+lowerI);
inValues=ones(size(x));
z=zeros(size(x));
c=(x+1i<i>y);<p>h_z=1:(stepsR</i>stepsI);
for counter=1:maxIter
z(h_z)=z(h_z).^2+c(h_z);
h_z= h_z(abs(z(h_z))<2);
inValues(h_z)=inValues(h_z)+1;
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%<p>%format presentation of Mandelbrot image
colormap jet;
pcolor(x,y,log(double(inValues)));
title('Mandelbrot Image: Zoom In and Sharpen for Details');
shading interp;
axis off;<p>zoom %turn on zoom feature initially
clear inValues<p>%Buttons:<p>%recalculate image to enhance after zooming in (just calls the function
%again with new input argument based on current axis)
h1= uicontrol('Parent',gcf,'Units','points', ...
'Callback',['mndl(axis);zoom;'], ...
'Position',[105 5 105 20],'Style','pushbutton','String','Sharpen (after zooming in)');<p>%turn the zoom button on or off
h2= uicontrol('Parent',gcf,'Units','points', ...
'Callback',['zoom'], ...
'Position',[215 5 55 20],'Style','pushbutton','String','Zoom On/Off');<p>%reset the image
h3= uicontrol('Parent',gcf,'Units','points', ...
'Callback',['mndl();zoom;'], ...
'Position',[275 5 40 20],'Style','pushbutton','String','Reset');