Mercurial > hg > camir-ismir2012
annotate toolboxes/MIRtoolbox1.3.2/MIRToolbox/@mirscalar/corrcoef.m @ 0:cc4b1211e677 tip
initial commit to HG from
Changeset:
646 (e263d8a21543) added further path and more save "camirversion.m"
author | Daniel Wolff |
---|---|
date | Fri, 19 Aug 2016 13:07:06 +0200 |
parents | |
children |
rev | line source |
---|---|
Daniel@0 | 1 function r = corrcoef(x,y) |
Daniel@0 | 2 |
Daniel@0 | 3 dx = get(x,'Data'); |
Daniel@0 | 4 dy = get(y,'Data'); |
Daniel@0 | 5 fx = get(x,'FramePos'); |
Daniel@0 | 6 fy = get(y,'FramePos'); |
Daniel@0 | 7 dr = cell(1,length(fx)); |
Daniel@0 | 8 for h = 1:length(fx) |
Daniel@0 | 9 dr{h} = cell(1,length(fx{h})); |
Daniel@0 | 10 for i = 1:length(fx{h}) |
Daniel@0 | 11 [f,ix,iy] = intersect(fx{h}{i}',fy{h}{i}','rows'); |
Daniel@0 | 12 dxi = dx{h}{i}(:,ix,:,:); |
Daniel@0 | 13 dyi = dy{h}{i}(:,iy,:,:); |
Daniel@0 | 14 dr{h}{i} = corrcoef(dxi,dyi); |
Daniel@0 | 15 end |
Daniel@0 | 16 end |
Daniel@0 | 17 r = mirmatrix(x,'Data',dr,'Title','Correlation coefficients','Unit',''); |