%% Var-Mean plot

for i=1:length(CSingleStates)
    CSvarMean2np10(i,2)=mean(CSingleStates(3,i).NP2eff);
    CSvarMean2np10(i,1)=var(CSingleStates(3,i).NP2eff);
    
    CSvarMeanMaxPnp10(i,2)=mean(CSingleStates(3,i).NPmaxPeff);
    CSvarMeanMaxPnp10(i,1)=var(CSingleStates(3,i).NPmaxPeff);
    
    CSvarMeanMaxmax(i,2)=mean(CSingleStates(3,i).NPmaxmax);
    CSvarMeanMaxmax(i,1)=var(CSingleStates(3,i).NPmaxmax);
        
    CSvarMeanMaxmaxund2(i,2)=mean(CSingleStates(3,i).NPmaxund2);
    CSvarMeanMaxmaxund2(i,1)=var(CSingleStates(3,i).NPmaxund2);
%     CSvarMean50(i,1)=var(CSingleStates(1,i).eff50);
%     CSvarMean100(i,1)=var(CSingleStates(1,i).eff100);
%     CSvarMean10(i,2)=mean(CSingleStates(1,i).eff10);
%     CSvarMean20(i,2)=mean(CSingleStates(1,i).eff20);
%     CSvarMean50(i,2)=mean(CSingleStates(1,i).eff50);
%     CSvarMean100(i,2)=mean(CSingleStates(1,i).eff100);

end

for i=1:length(CSingleStates)
   CSvarMeanTW10(i,1)=var(CSingleStates(1,i).eff10);
      CSvarMeanTW20(i,1)=var(CSingleStates(1,i).eff20); 
         CSvarMeanTW50(i,1)=var(CSingleStates(1,i).eff50); 
            CSvarMeanTW100(i,1)=var(CSingleStates(1,i).eff100); 
  CSvarMeanTW10(i,2)=mean(CSingleStates(1,i).eff10);
      CSvarMeanTW20(i,2)=mean(CSingleStates(1,i).eff20); 
         CSvarMeanTW50(i,2)=mean(CSingleStates(1,i).eff50); 
            CSvarMeanTW100(i,2)=mean(CSingleStates(1,i).eff100); 
end



figure; scatter (CSvarMean20(1:53,2),CSvarMean20(1:53,3));
%% Usual Var/Mean
figure; 
subplot(2,2,1)
scatter (CSvarMeanTW10(1:84,2),CSvarMeanTW10(1:84,1));
subplot(2,2,2)
scatter (CSvarMeanTW20(1:84,2),CSvarMeanTW20(1:84,1));
subplot(2,2,3)
scatter (CSvarMeanTW50(1:84,2),CSvarMeanTW50(1:84,1));
subplot(2,2,4)
scatter (CSvarMeanTW100(1:84,2),CSvarMeanTW100(1:84,1));
figure;
subplot(2,2,1)
scatter (CSvarMean2np10(1:84,2),CSvarMean2np10(1:84,1));
subplot(2,2,2)
scatter (CSvarMeanMaxPnp10(1:84,2),CSvarMeanMaxPnp10(1:84,1));
subplot(2,2,3)
scatter (CSvarMeanMaxmax(1:84,2),CSvarMeanMaxmax(1:84,1));
subplot(2,2,4)
scatter (CSvarMeanMaxmaxund2(1:84,2),CSvarMeanMaxmaxund2(1:84,1));






for i=1:length(succesNP(:,1))
% CSvarMeanNP2_20(i,1)=var(CSingleStates(1,succesNP(i,1)).NP2_20);
% CSvarMeanNP5_20(i,1)=var(CSingleStates(1,succesNP(i,1)).NP5_20);
% CSvarMeanNP10_20(i,1)=var(CSingleStates(1,succesNP(i,1)).NP10_20);
% CSvarMeanNP10_200(i,1)=var(CSingleStates(1,succesNP(i,1)).NP10_200);
% CSvarMeanNP100_1000(i,1)=var(CSingleStates(1,succesNP(i)).NP100_1000);
 CSvarMeanNP200_1000(i,1)=var(CSingleStates(1,succesNP(i,1)).NP200_1000);
% CSvarMeanNP200_2000(i,1)=var(CSingleStates(1,succesNP(i,1)).NP200_2000);
% 
% CSvarMeanNP2_20(i,2)=mean(CSingleStates(1,succesNP(i,1)).NP2_20);
% CSvarMeanNP5_20(i,2)=mean(CSingleStates(1,succesNP(i,1)).NP5_20);
% CSvarMeanNP10_20(i,2)=mean(CSingleStates(1,succesNP(i,1)).NP10_20);
% CSvarMeanNP10_200(i,2)=mean(CSingleStates(1,succesNP(i,1)).NP10_200);    
% CSvarMeanNP100_1000(i,2)=mean(CSingleStates(1,succesNP(i,1)).NP100_1000);    
 CSvarMeanNP200_1000(i,2)=mean(CSingleStates(1,succesNP(i,1)).NP200_1000);    
% CSvarMeanNP200_2000(i,2)=mean(CSingleStates(1,succesNP(i,1)).NP200_2000);    
% 
% CSvarMeanNP2_20(i,3)=sqrt(CSvarMeanNP2_20(i,1));
% CSvarMeanNP5_20(i,3)=sqrt(CSvarMeanNP5_20(i,1));
% CSvarMeanNP10_20(i,3)=sqrt(CSvarMeanNP10_20(i,1));
% CSvarMeanNP10_200(i,3)=sqrt(CSvarMeanNP10_200(i,1));
% CSvarMeanNP100_1000(i,3)=sqrt(CSvarMeanNP100_1000(i,1));
CSvarMeanNP200_1000(i,3)=sqrt(CSvarMeanNP200_1000(i,1));
% CSvarMeanNP200_2000(i,3)=sqrt(CSvarMeanNP200_2000(i,1));


    end
    figure; scatter (CSvarMean2np10(1:84,2),CSvarMean2np10(1:84,1));
        figure; scatter (CSvarMeanMaxPnp10(1:84,2),CSvarMeanMaxPnp10(1:84,1));
    