view toolboxes/MIRtoolbox1.3.2/MIRToolbox/@mirscalar/corrcoef.m @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
line wrap: on
line source
function r = corrcoef(x,y)

dx = get(x,'Data');
dy = get(y,'Data');
fx = get(x,'FramePos');
fy = get(y,'FramePos');
dr = cell(1,length(fx));
for h = 1:length(fx)
    dr{h} = cell(1,length(fx{h}));
    for i = 1:length(fx{h})
        [f,ix,iy] = intersect(fx{h}{i}',fy{h}{i}','rows');
        dxi = dx{h}{i}(:,ix,:,:);
        dyi = dy{h}{i}(:,iy,:,:);
        dr{h}{i} = corrcoef(dxi,dyi);
    end
end
r = mirmatrix(x,'Data',dr,'Title','Correlation coefficients','Unit','');