Mercurial > repos > public > sbplib
view spdiagVariable.m @ 795:1f6b2fb69225 feature/poroelastic
Revert bcSetup and update bc functions in elastic schemes to be compatible.
author | Martin Almquist <malmquist@stanford.edu> |
---|---|
date | Wed, 25 Jul 2018 18:33:03 -0700 |
parents | 7368affc8f78 |
children |
line wrap: on
line source
function A = spdiagVariable(a,i) default_arg('i',0); if isrow(a) a = a'; end n = length(a)+abs(i); if i > 0 a = [sparse(i,1); a]; elseif i < 0 a = [a; sparse(abs(i),1)]; end A = spdiags(a,i,n,n); end