Home > vbmeg > functions > tool_box > linear_connectome_dynamics_toolbox > lcd_ab2conmar.m

lcd_ab2conmar

PURPOSE ^

AB FORMS TO CONCATENATED MAR MATRIX

SYNOPSIS ^

function conMAR=lcd_ab2conmar(A,B,Delta,fuflag)

DESCRIPTION ^

 AB FORMS TO CONCATENATED MAR MATRIX
 
 [Input]
  A : MAR coefficient for self node   [Nv p]
  B : MAR coefficients from other nodes [Nv Nv]
 Delta : delay matrix (unit:time point) [Nv Nv]
 fuflag : if 1, Fukushima-MAR model is used 

 [Output]
 conMAR : concatenated MAR matrix [Nv Nv*Dmax]

 2016/04/13 O.Yamashita
 * [Bugfix] wrong diagonal components of Fu-MAR are corrected.
 2016/01/28 O.Yamashita

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function conMAR=lcd_ab2conmar(A,B,Delta,fuflag)
0002 % AB FORMS TO CONCATENATED MAR MATRIX
0003 %
0004 % [Input]
0005 %  A : MAR coefficient for self node   [Nv p]
0006 %  B : MAR coefficients from other nodes [Nv Nv]
0007 % Delta : delay matrix (unit:time point) [Nv Nv]
0008 % fuflag : if 1, Fukushima-MAR model is used
0009 %
0010 % [Output]
0011 % conMAR : concatenated MAR matrix [Nv Nv*Dmax]
0012 %
0013 % 2016/04/13 O.Yamashita
0014 % * [Bugfix] wrong diagonal components of Fu-MAR are corrected.
0015 % 2016/01/28 O.Yamashita
0016 
0017 if nargin < 4
0018     fuflag = 0;
0019 end
0020 
0021 [Nv,Np] = size(A);
0022 Dmax = max(max(Delta(:)),Np);
0023 % form transition matrix
0024 conMAR = zeros(Nv,Nv,Dmax);
0025 for uu = 1 : Nv
0026     % nondiagonal part
0027     for vv = 1 : Nv
0028         if Delta(uu,vv) ~= 0 & uu ~= vv
0029         conMAR(uu,vv,Delta(uu,vv)) = B(uu,vv);
0030         end
0031     end
0032     % diagonal part
0033     if fuflag
0034         conMAR(uu,uu,Delta(uu,uu)) = A(uu,1);
0035     else
0036         for aa = 1 : Np
0037             conMAR(uu,uu,aa) = A(uu,aa);
0038         end
0039     end
0040 end
0041 conMAR = reshape(conMAR,[Nv Nv*Dmax]);
0042 conMAR = sparse(conMAR); 
0043 
0044

Generated on Mon 22-May-2023 06:53:56 by m2html © 2005