Hi Matlab World,
I am trying to find the significance of the correlation coefficients between two variables ssh and t (Zip file attached). I have hence used the following code:
lat = ncread('ssh.nc','latitude');lon = ncread('ssh.nc','longitude');ssh = ncread('ssh.nc','zos');t = ncread('ssh.nc','bottomT');nx=length(lon);ny=length(lat);rxy = zeros(nx,ny) ; sxy = zeros(nx,ny) ;for i=1:nx for j=1:ny [r,s] = corr(squeeze(t(i,j,:)),squeeze(ssh(i,j,:))); rxy(i,j)=r; endend
I wanted to find how much of the area has significant correlation at 95% significance level (p value < 0.05) and plot it thereafter. Looking forward to your assistance.
Best Answer