Mercurial > hg > camir-aes2014
diff 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 diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/toolboxes/MIRtoolbox1.3.2/MIRToolbox/@mirscalar/corrcoef.m Tue Feb 10 15:05:51 2015 +0000 @@ -0,0 +1,17 @@ +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',''); \ No newline at end of file