%Scrap

%PortConcDiff=[];
for i= 1:size(index),
    if i==1
        PortAveConc=mean(PortO2Conc(1:index(i)));
        PortConcDiff(1:index(i),1)=PortO2Conc(1:index(i),1)-PortAveConc;
        PortAveTime=Portdatetime(index(i));
    else
        PortAveConc=[PortAveConc;mean(PortO2Conc(index(i-1)+1:index(i)))];
        PortConcDiff=[PortConcDiff;PortO2Conc(index(i-1)+1:index(i),1)-mean(PortO2Conc(index(i-1)+1:index(i)))];
        PortAveTime=[PortAveTime;Portdatetime(index(i))];
    end
end
PortAveConc=[PortAveConc;mean(PortO2Conc(index(i)+1:end))];
PortAveTime=[PortAveTime;Portdatetime(end)];
 PortConcDiff=[PortConcDiff;PortO2Conc(index(i)+1:end,1)-mean(PortO2Conc(index(i)+1:end))];
       
