G=100000; Lmin=400; Lmax=600; M = 100; Nmax = 500;

FC = zeros(Nmax-1,1); % Contig Anzahl gegen Fragment Anzahl
FL = zeros(Nmax-1,1); % Contig Laenge gegen Fragment Anzahl

more off;
for N = 2:Nmax

  [ FC(N,1), FL(N,1) ] = shotGun(G,Lmin,Lmax,N,M,0);

  printf("N = %d\r",N); fflush(0);
end
printf("\n");
more on;

Lm = (Lmax+Lmin)/2;


figure(0);
tit = sprintf("Fragmente vs Contig Anzahl\n(G = %d,  L = [ %d, %d ] (L=%d),  M = %d)",G,Lmin,Lmax,Lm,M);  
title(tit);
plot(2:Nmax,FC(2:Nmax));
hold on;
Nmaximum = G/Lm;
plot([Nmaximum,Nmaximum],[0,max(FC)]);
hold off;

gset term postscript;
tit = sprintf("gset output \"Anzahl_%d_%d,%d_%d_%d_%d.ps\";",G,Lmin,Lmax,Lm,Nmax,M);  
eval (tit);
replot; gset term x11;

figure(1);
tit = sprintf("Fragmente vs Contig Laenge\n(G = %d,  L = [ %d, %d ] (L=%d),  M = %d)",G,Lmin,Lmax,Lm,M);  
title(tit);
plot(2:Nmax,FL(2:Nmax));
gset term postscript;
tit = sprintf("gset output \"Laenge_%d_%d,%d_%d_%d_%d.ps\";",G,Lmin,Lmax,Lm,Nmax,M);  
eval (tit);
replot; gset term x11;
