view spdiag.m @ 479:c5705458beb1 feature/sublassable_cellarray

Implement end function and fix test for colon indexing
author Jonatan Werpers <jonatan@werpers.com>
date Wed, 02 Aug 2017 11:19:10 +0200
parents 9c0192cf099f
children 8e0067aef5b0
line wrap: on
line source

function A = spdiag(a,i)
    default_arg('i',0);
    n = length(a)-abs(i);
    A = spdiags(a,i,n,n);
end