% Create a 100x100 matrix with all zeros
img = zeros(100,100);
% Create a horizontal rectangle
img(40:59,20:79) = 1;
img(20:79,40:59) = 1;
% imagesc(img); % show the image
% Create Gaussian function
[x,y] = meshgrid([-5:1:5],[-5:1:5]);
gf = @(x,y,w) exp(-((x).^2+(y).^2)/w);
% imagesc(gf(x,y,10));colormap('gray');
figure; % new window for figure
i = 0;
for w = [1 3 5 7 9]
    i = i+1;
    subplot(1,5,i);
    imagesc(gf(x,y,w));colormap('gray');
    title(['Gaussian Function w/ w =',num2str(w)]);
end
figure;
i = 0;
for w = [1 3 5 7 9]
    i = i+1;
    subplot(1,5,i);
    imagesc(conv2(img,gf(x,y,w)));colormap('gray');
    title(['Blurred image w/ w =',num2str(w)]);
end