% Purpose: find correlation coefficient between two spatial fields load M_19940105_19991229_ref_highpass0.mat M_e = M; clear M load M_20000105_20051228_ref.mat M_l = M; clear M [X,Y]=meshgrid(NbLongitudes,NbLatitudes); load ../../Bottom_Topography/topography.mat min_depth = 1000; min_lat = 25; g = find(abs(Y)>min_lat & ~isnan(M_e+M_l) & TopoInterp<-min_depth); tmp = corrcoef(M_e(g),M_l(g)); disp(strcat('mask lat<=',int2str(min_lat),'mask depth <=',int2str(min_depth))) r = tmp(1,2) EKE = (usq + vsq)/2; [tmp i] = sort(EKE(g)); weak = g(i(1:floor(0.75*end))); tmp = corrcoef(M_e(weak),M_l(weak)); disp(strcat('mask lat<=',int2str(min_lat),'mask depth <=',int2str(min_depth))) disp('mask EKE > 75 percentile') r = tmp(1,2)