clear all;
close all;
load H04S5_amoc.mat
load voltr24


plot(AMOC);
hold on;
plot(-voltrcat_24,'r');
axis tight;
for n=1:48
% n=3;
n
R=corrcoef(AMOC(n:end),-voltrcat_24(1:end-n+1))
% R=corrcoef(AMOC(1:end-n+1),-voltrcat_24(n:end))
RR(n)=R(1,2);
end
% R=0.4791;
figure
plot(RR,'-*')
grid on;
title('AMOC lag correlatoin');
pause
%%
clear all;
close all;
load H04S5_amoc.mat
load voltr24


plot(AMOC);
hold on;
plot(-voltrcat_24,'r');
axis tight;
for n=1:48
% n=3;
n
% R=corrcoef(AMOC(n:end),-voltrcat_24(1:end-n+1))
R=corrcoef(AMOC(1:end-n+1),-voltrcat_24(n:end))
RR(n)=R(1,2);
end
% R=0.4791;
figure
plot(RR,'-*')
grid on;
title('24.5N lag correlatoin');