clear all; close all;

sigs    = 0:0.0001:0.001;
Nsigs   = length(sigs);
thetas  = linspace(0,5,20);
Nthetas = length(thetas);

[Thetas Sigs] = meshgrid(thetas,sigs);
data = zeros([size(Thetas) 4]);

for i = 1:Nsigs
    sig = sigs(i);
    for j = 1:Nthetas
        theta = thetas(j);
        prefix = sprintf('*sig0_%04.0f_theta%02.0f_%1.0f_no*',...
                    sig*1e4,theta,mod(theta*10,10));
        files  = dir(prefix);
        Nfiles = length(files);
        
        % Analyze each file
        for fi = 1:Nfiles
            load(files(fi).name);
            runMatthieu_DR;
            drawnow;
            
            % Save data
            data(i,j,fi) = app;
        end
    end
end