clear all; clc; close all;

ncells = 1;
ncycles = 465;

tmax = 600;
systemsize = 5000;
ismutant = true;

% [htimecourse,hcyclestats] = ccmodel(systemsize,ismutant);
% [ct,bm,dm] = hcyclestats(ncells,ncycles);
% save('ccstats', 'ct', 'bm', 'dm')

%%

load(['ccstats_', num2str(systemsize)])

mu_ct = mean(ct);
std_ct = std(ct);
cv_ct = std_ct/mu_ct;
mu_bm = mean(bm);
std_bm = std(bm);
cv_bm = std_bm/mu_bm;
mu_dm = mean(dm);
std_dm = std(dm);
cv_dm = std_dm/mu_dm;

param = [mu_ct, std_ct, cv_ct, mu_bm, std_bm, cv_bm, mu_dm, std_dm, cv_dm];

% csvwrite(['ccstats_', num2str(systemsize), '.dat'],param)

figure('Name', ['CT histogram for system size of ', num2str(systemsize)])
hist(ct,100)
xlabel('CT (min)');
ylabel('number of cells');

figure('Name', ['CT vs BM for system size of ', num2str(systemsize)])
plot(bm, ct, '+', 'LineWidth',0.5, 'MarkerSize',2)     
set(gca, 'xlim', [0.98 1.89], 'box', 'on');
xlabel('birth mass (a.u.)');
ylabel('CT (min)');



