Mercurial > repos > public > sbplib
view +blockmatrix/zero.m @ 214:f0f4ca946068 feature/beams
blockmatrix: added a test to make sure a zero matrix is a blockmatrix. Also added input parameter checking to zero()
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Wed, 22 Jun 2016 14:42:01 +0200 |
parents | d521e17f72b6 |
children | a5f1b0267dba |
line wrap: on
line source
% Creates a block matrix according to the division with zeros everywhere. function bm = zero(div) if ~blockmatrix.isDivision(div); error('div is not a valid division'); end n = div{1}; m = div{2}; N = length(n); M = length(m); bm = cell(N,M); for i = 1:N for j = 1:M bm{i,j} = sparse(n(i),m(j)); end end end