view spdiag.m @ 850:4e5e53d6336c feature/burgers1d

Correct documentation of Rungekutta
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Fri, 21 Sep 2018 09:14:38 +0200
parents e76321b89c1e
children
line wrap: on
line source

function A = spdiag(a,i)
    default_arg('i',0);

    if isrow(a)
        a = a';
    end

    n = length(a)+abs(i);
    A = spdiags(a,i,n,n);
end