Home > BauerLab > MATLAB > lib > +mouse > +conn > getFC.m

getFC

PURPOSE ^

getFC produces functional connectivity matrix from data

SYNOPSIS ^

function fcMatrix = getFC(data)

DESCRIPTION ^

getFC produces functional connectivity matrix from data
   Inputs:
       data = nD matrix as long as last dim is time
   Outputs:
       fcMatrix = m x m matrix where m is product of all dimensions of
       data except last one. Pearson's correlation (-1 to 1)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function fcMatrix = getFC(data)
0002 %getFC produces functional connectivity matrix from data
0003 %   Inputs:
0004 %       data = nD matrix as long as last dim is time
0005 %   Outputs:
0006 %       fcMatrix = m x m matrix where m is product of all dimensions of
0007 %       data except last one. Pearson's correlation (-1 to 1)
0008 
0009 dataSize = size(data);
0010 data = reshape(data,[],dataSize(end));
0011 
0012 covMat = data*data';
0013 stdVal = std(data,[],2);
0014 stdMat = stdVal*stdVal';
0015 
0016 fcMatrix = covMat./stdMat;
0017 fcMatrix = fcMatrix./max(fcMatrix(:)); % normalize
0018 end
0019

Generated on Fri 28-Dec-2018 21:42:50 by m2html © 2005