figure
plot(depth,PRy03)
hold on
plot(depth,mean(PRy03,2),'k','linew',2)
xlim([0 1200])
%%
%norm_PRy03 = bsxfun(@rdivide,PRy03, max(PRy03,[],1));
%norm_PRy02 = bsxfun(@rdivide,PRy02, max(PRy02,[],1));

RatYFP = [PRy02 PRy03];



%norm_total = bsxfun(@rdivide, total, max(total,[],1));
%% Normalization
norm_RatYFP = NormalizeTraces (RatYFP);

% Mouse data start from 50 um
startidx = dsearchn(MouseDepth,50);
MouseYFPnew = MouseYFP;
MouseYFPnew(1:startidx,:) = []; 
%MouseDepthNew = MouseDepth(startidx:end);
norm_MouseYFP = NormalizeTraces (MouseYFPnew);


%%
figure
plot(RatDepth,norm_RatYFP)
hold on
boundedline(RatDepth, nanmean(norm_RatYFP,2), nanstd(norm_RatYFP,[],2)./sqrt(size(norm_RatYFP,2)),'k-') 
xlim([0 1200])
xlabel('Depth (um)')
ylabel('Normalized intensity')


%%
figure
plot(MouseDepth,norm_MouseYFP)
hold on
boundedline(MouseDepth, nanmean(norm_MouseYFP,2), nanstd(norm_MouseYFP,[],2)./sqrt(size(norm_MouseYFP,2)),'k-') 
xlim([50 1000])
xlabel('Depth (um)')
ylabel('Normalized intensity')
