% Add the necessary lines of code after line 25 to compute the TSVD
% solution of the linear equation Ax=mncn.
%
% (This is not very efficient coding, and it is done only for educational
% purposes.)
%
% The following routines must be run before this file:
% XRM1_matrix_comp.m and XRM3_NoCrimeData_comp.m.
% Load noisy measurements from disc.
loadcommand = ['load data/XRMC_NoCrime', num2str(N), ' N mnc mncn'];
eval(loadcommand)
mn = mncn;
% Load the measurement matrix
loadcommand = ['load data/RadonMatrix', num2str(N), ' A measang target N P Nang'];
eval(loadcommand)
% Now we have the matrix A and measurement mncn and we would like to compute
% the TSVD solution x for the equation Ax = mncn
% using M singular values (vectors)
M = 1;
% (add the needed code here)
% Plot M:s singular vector, the reconstruction s and original image
figure(1);
subplot(1,3,1)
imagesc(reshape(V(:,M),N,N));
colormap gray
axis square
axis off
title('Singular vector')
subplot(1,3,2)
imagesc(reshape(x,N,N));
colormap gray
axis square
axis off
title('Reconstruction')
subplot(1,3,3)
imagesc(target);
colormap gray
axis square
axis off
title('Original image')