%% Var-Mean plot

for i=1:length(CSingleStates)
    CSvarMean2np10(i,2)=mean(CSingleStates(1,i).NP2_10);
    CSvarMean2np10(i,1)=var(CSingleStates(1,i).NP2_10);
    CSvarMean2np20(i,2)=mean(CSingleStates(1,i).NP2_20);
    CSvarMean2np20(i,1)=var(CSingleStates(1,i).NP2_20);
%     
%     CSvarMeanMaxPnp10(i,2)=mean(CSingleStates(3,i).NPmaxPeff);
%     CSvarMeanMaxPnp10(i,1)=var(CSingleStates(3,i).NPmaxPeff);
    
    CSvarMeanMaxmax(i,2)=mean(CSingleStates(1,i).NPmaxP);
    CSvarMeanMaxmax(i,1)=var(CSingleStates(1,i).NPmaxP);
        
    CSvarMeanMaxmaxund1(i,2)=mean(CSingleStates(1,i).NPmaxPtw1);
    CSvarMeanMaxmaxund1(i,1)=var(CSingleStates(1,i).NPmaxPtw1);
%     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

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


for i=1:length(CSingleStates)
   CSvarMeanPtw2(i,1)=var(CSingleStates(1,i).NPmaxPtw2);
      CSvarMeanPtw3(i,1)=var(CSingleStates(1,i).NPmaxPtw3); 
         CSvarMeanPtw4(i,1)=var(CSingleStates(1,i).NPmaxPtw3); 
            CSvarMeanPtw5(i,1)=var(CSingleStates(1,i).NPmaxPtw5); 
  CSvarMeanPtw2(i,2)=mean(CSingleStates(1,i).NPmaxPtw2);
      CSvarMeanPtw3(i,2)=mean(CSingleStates(1,i).NPmaxPtw3); 
         CSvarMeanPtw4(i,2)=mean(CSingleStates(1,i).NPmaxPtw4); 
            CSvarMeanPtw5(i,2)=mean(CSingleStates(1,i).NPmaxPtw5); 
end

for i=1:length(CSingleStates)
   CSvarMeanPtw6(i,1)=var(CSingleStates(1,i).NPmaxPtw6);
      CSvarMeanPtw7(i,1)=var(CSingleStates(1,i).NPmaxPtw7); 
         CSvarMeanPtw8(i,1)=var(CSingleStates(1,i).NPmaxPtw8); 
            CSvarMeanPtw9(i,1)=var(CSingleStates(1,i).NPmaxPtw9); 
  CSvarMeanPtw6(i,2)=mean(CSingleStates(1,i).NPmaxPtw7);
      CSvarMeanPtw7(i,2)=mean(CSingleStates(1,i).NPmaxPtw7); 
         CSvarMeanPtw8(i,2)=mean(CSingleStates(1,i).NPmaxPtw8); 
            CSvarMeanPtw9(i,2)=mean(CSingleStates(1,i).NPmaxPtw9); 
end

for i=1:length(CSingleStates)
   CSvarMeanPtw10(i,1)=var(CSingleStates(1,i).NPmaxPtw10);
      CSvarMeanPtw2max(i,1)=var(CSingleStates(1,i).NPmaxPtw2max); 
         CSvarMeanPtw2p5max(i,1)=var(CSingleStates(1,i).NPmaxPtw2p5max); 
            CSvarMeanPtw3max(i,1)=var(CSingleStates(1,i).NPmaxPtw3max); 
  CSvarMeanPtw10(i,2)=mean(CSingleStates(1,i).NPmaxPtw10);
      CSvarMeanPtw2max(i,2)=mean(CSingleStates(1,i).NPmaxPtw2max); 
         CSvarMeanPtw2p5max(i,2)=mean(CSingleStates(1,i).NPmaxPtw2p5max); 
            CSvarMeanPtw3max(i,2)=mean(CSingleStates(1,i).NPmaxPtw3max); 
end


for i=1:length(CSingleStates)
   CSvarMeanhalfPtwmax(i,1)=var(CSingleStates(1,i).NPhalfmaxPtwmax);
%       CSvarMean(i,1)=var(CSingleStates(1,i).0); 

  CSvarMeanhalfPtwmax(i,2)=mean(CSingleStates(1,i).NPhalfmaxPtwmax);
%       CSvarMean(i,2)=mean(CSingleStates(1,i).); 
end

for i=1:length(maxminus)
       CSvarMeanmaxminus(i,1)=var(CSingleStates(1,maxminus(i)).NPmaxminus10Ptwmax ); 
       CSvarMeanmaxminus(i,2)=mean(CSingleStates(1,maxminus(i)).NPmaxminus10Ptwmax); 
end


for i=1:length(CSingleStates)
   CSvarMean(i,1)=var(CSingleStates(1,i).);
      CSvarMean(i,1)=var(CSingleStates(1,i).0); 
         CSvarMean(i,1)=var(CSingleStates(1,i).); 
            CSvarMean(i,1)=var(CSingleStates(1,i).); 
  CSvarMean(i,2)=mean(CSingleStates(1,i).);
      CSvarMean(i,2)=mean(CSingleStates(1,i).); 
         CSvarMean(i,2)=mean(CSingleStates(1,i).); 
            CSvarMean(i,2)=mean(CSingleStates(1,i).); 
end




%% Usual Var/Mean
figure;
subplot(2,2,1)
scatter (CSvarMeanTW10(1:72,2),CSvarMeanTW10(1:72,1));
subplot(2,2,2)
scatter (CSvarMeanTW20(1:72,2),CSvarMeanTW20(1:72,1));
subplot(2,2,3)
scatter (CSvarMeanTW50(1:72,2),CSvarMeanTW50(1:72,1));
subplot(2,2,4)
scatter (CSvarMeanTW100(1:72,2),CSvarMeanTW100(1:72,1));
%% NP Var/Mean
figure; 
subplot(2,2,1)
scatter (CSvarMean2np10(1:72,2),CSvarMean2np10(1:72,1));
subplot(2,2,2)
scatter (CSvarMean2np20(1:72,2),CSvarMean2np20(1:72,1));
subplot(2,2,3)
scatter (CSvarMeanMaxmax(1:72,2),CSvarMeanMaxmax(1:72,1));
subplot(2,2,4)
scatter (CSvarMeanMaxmaxund1(1:72,2),CSvarMeanMaxmaxund1(1:72,1));



figure; 
subplot(2,2,1)
scatter (CSvarMeanPtw2(1:72,2),CSvarMeanPtw2(1:72,1));
subplot(2,2,2)
scatter (CSvarMeanPtw3(1:72,2),CSvarMeanPtw3(1:72,1));
subplot(2,2,3)
scatter (CSvarMeanPtw4(1:72,2),CSvarMeanPtw4(1:72,1));
subplot(2,2,4)
scatter (CSvarMeanPtw5(1:72,2),CSvarMeanPtw5(1:72,1));

figure; 
subplot(2,2,1)
scatter (CSvarMeanPtw6(1:72,2),CSvarMeanPtw6(1:72,1));
subplot(2,2,2)
scatter (CSvarMeanPtw7(1:72,2),CSvarMeanPtw7(1:72,1));
subplot(2,2,3)
scatter (CSvarMeanPtw8(1:72,2),CSvarMeanPtw8(1:72,1));
subplot(2,2,4)
scatter (CSvarMeanPtw9(1:72,2),CSvarMeanPtw9(1:72,1));


figure; 
subplot(2,2,1)
scatter (CSvarMeanPtw10(1:72,2),CSvarMeanPtw10(1:72,1));
subplot(2,2,2)
scatter (CSvarMeanPtw2max(1:72,2),CSvarMeanPtw2max(1:72,1));
subplot(2,2,3)
scatter (CSvarMeanPtw2p5max(1:72,2),CSvarMeanPtw2p5max(1:72,1));
subplot(2,2,4)
scatter (CSvarMeanPtw3max(1:72,2),CSvarMeanPtw3max(1:72,1));

figure; 
scatter (CSvarMeanmaxminus(1:72,2),CSvarMeanmaxminus(1:72,1));

figure; 
subplot(2,2,1)
scatter (CSvarMean(1:72,2),CSvarMean(1:72,1));
subplot(2,2,2)
scatter (CSvarMean(1:72,2),CSvarMean(1:72,1));
subplot(2,2,3)
scatter (CSvarMean(1:72,2),CSvarMean(1:72,1));
subplot(2,2,4)
scatter (CSvarMean(1:72,2),CSvarMean(1:72,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
for i=1:4
end
figure;
    subplot(2,2,1)
 scatter (VarMean.NPvar5_10,VarMean.NPmean5_10);
     subplot(2,2,2)
 scatter (VarMean.NPvarT5_15,VarMean.NPmean5_25);
     subplot(2,2,3)
 scatter (VarMean.NPvar5_20,VarMean.NPmean5_20);
     subplot(2,2,4)
 scatter (VarMean.NPvar5_25,VarMean.NPmean5_25);
     
        
        
    