function generateGraphs

%%% Parameters
range_n = [ 100 200 500 1000 ];
howManyP = 5; %How many values of p for each n.
howManyGraphs = 1; %How many graphs for each combo of n and p.
randomSeed = 1; %Starting seed, incremented once for each matrix generated.
decimals = 3; %no. of decimals in p

%%% Write settings file
fid = fopen('.settings','wt');
fprintf(fid, 'Erdos-Renyi graphs generated %s\n', date);
fprintf(fid, 'range_n::%s\n', num2str(range_n));
fprintf(fid, 'howManyP::%g\n', howManyP);
fprintf(fid, 'decimals::%g\n', decimals);
fprintf(fid, 'howManyGraphs::%g\n', howManyGraphs);
fprintf(fid, 'randomSeed::%g\n', randomSeed);
fclose(fid);
disp('.settings');

%%% The main loop
for n = range_n
    for g = 1:howManyGraphs
        %Generate n-by-n symmetric matrix of random numbers
        A = randomMatrix(n, randomSeed);
        %Make adjacency matrices
        for p = getProbabilities(n, howManyP, decimals)
            adj = buildAdjacencyMatrix(A, p);
            saveAdjacencyMatrix(adj, n, p, decimals, randomSeed);
        end
        randomSeed = randomSeed + 1;
    end
end

end