% 1D example % Build object clear all, close all t=[0:0.02:1]'; x=1*(t>0.25&t<0.75); % Build blurring matrix and compute image m=length(t); c = zeros(m,1); c(1:5) = [5:-1:1]'/25; A = toeplitz(c); b = A*x+0.1*randn(m,1); % Plot object, image and naive solution. xnaive=A\b; figure(1) plot(t,x,'g-',t,b,'r--',t,xnaive) axis([0 1 -0.5 1.5]) legend('true','blurred','naive solution')