% Makes a vertical blur distortion operator E 
% for use with image I and the file Eblur.m.
% I, D must be defined in the workspace.
% Make D with the file makeD.m.

[m,n] = size(I);
mn = m*n;

nzmax = (2*blur+1)*mn;
E = spalloc(mn,mn,nzmax);
A = D;
for i = 1:n-1
    A = [A, zeros(i*m, m); zeros(m, i*m), D];
end
E = A;

figure('Units', 'Normalized', 'Position', [.55, .2, .4, .6])
spy(E)
title(strvcat('Vertical Blur Distortion Operator E',...
['(Entries have value 1/(2*blur+1) = ' , num2str(1/(2*blur+1)), ')']))

clear m n mn nzmax A i