% Plot the results of XRM5_SVD_comp.m.
%
% Arguments:
% N    resolution of the image is N x N
%
% Samuli Siltanen October 2012

function XRM5_SVD_plot(N)

% Plot parameters
msize  = 8;
lwidth = 2;
smallfsize  = 14;
largefsize  = 22;

% Load precomputed results. 
loadcommand = ['load data/XRME_SVD', num2str(N), ' U D V A measang target N P Nang'];
eval(loadcommand)
svals1 = full(diag(D));

% Show nonzero elements of the convolution matrix
figure(1)
clf
spy(A)

% Plot singular values of A on a logarithmic scale
figure(3)
clf
semilogy(svals1,'r','linewidth',lwidth)
xlim([1 length(svals1)])
title('Singular values of A')

