clear; close all;

KSVDData = load('maindata_KSVD.mat');
SimCOData = load('maindata_regSimCO.mat');

figure; 
x = KSVDData.Nv;
x = reshape(x,length(x),1);
y = mean(KSVDData.f_save,2)./x;
plot(x,y,'b--x','LineWidth',1.5);
grid on; hold on;
x = SimCOData.Nv;
x = reshape(x,length(x),1);
y = mean(SimCOData.f_save,2)./x;
plot(x,y,'r-+','LineWidth',1.5);

xlabel('n : # of training samples');
ylabel('|| Y - D X || _F^2 / n');
title('Synthetic Data Test with OMP: m=16, d=32, S=4, # of realization=50, # of iterations=50');
legend( ...
    'K-SVD',...
    'Regularized SimCO',...
    'Location','Best');
legend ('boxoff');
