Mercurial > repos > public > sbplib
comparison spdiag.m @ 592:4422c4476650 feature/utux2D
Merge with feature/grids
author | Martin Almquist <martin.almquist@it.uu.se> |
---|---|
date | Mon, 11 Sep 2017 14:17:15 +0200 |
parents | 8e0067aef5b0 |
children | e76321b89c1e |
comparison
equal
deleted
inserted
replaced
591:39554f2de783 | 592:4422c4476650 |
---|---|
1 function A = spdiag(a,i) | 1 function A = spdiag(a,i) |
2 default_arg('i',0); | 2 default_arg('i',0); |
3 | |
4 if isrow(a) | |
5 a = a'; | |
6 end | |
7 | |
3 n = length(a)-abs(i); | 8 n = length(a)-abs(i); |
4 A = spdiags(a,i,n,n); | 9 A = spdiags(a,i,n,n); |
5 end | 10 end |