ROWPATHRATIO compute horizontal propagation of connection matrix [ pathRatioVector ] = rowPathRatio( connectMatrix ) This function compute percentage of how many input-output pathway has been established in this connection matrix. Input: connectMatrix: a matrix which row is input nodes and column is output nodes. Each elements is pathway number between input and output nodes. Output: pathRatioVector: a vector, in which element is percentage of how many input-output pathway has been established
0001 function [ pathRatioVector ] = rowPathRatio( connectMatrix ) 0002 % ROWPATHRATIO compute horizontal propagation of connection matrix 0003 % 0004 % [ pathRatioVector ] = rowPathRatio( connectMatrix ) 0005 % This function compute percentage of how many input-output pathway has been 0006 % established in this connection matrix. 0007 % 0008 % Input: 0009 % connectMatrix: a matrix which row is input nodes and column is output 0010 % nodes. Each elements is pathway number between input and output 0011 % nodes. 0012 % 0013 % Output: 0014 % pathRatioVector: a vector, in which element is percentage of how many 0015 % input-output pathway has been established 0016 0017 % --------- 0018 % Yen-Nan Lin, NTHU, 2010-2014, Matlab 2012a 0019 0020 connectMatrix = full(connectMatrix); 0021 [nRow, nCol] = size(connectMatrix); 0022 pathRatioVector = zeros(1, nRow); 0023 for iRow = 1:nRow 0024 connectIx = find(connectMatrix(iRow, :) > 0); 0025 pathRatioVector(iRow) = numel(connectIx) / nCol; 0026 end 0027 end