Mercurial > repos > public > sbplib
diff assertLength.m @ 989:e41c93d7ab08 feature/timesteppers
Merge with default
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Wed, 09 Jan 2019 08:56:42 +0100 |
parents | 1d70f29c7ab2 |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/assertLength.m Wed Jan 09 08:56:42 2019 +0100 @@ -0,0 +1,4 @@ +function assertLength(A,l) + assert(isvector(A), sprintf('Expected ''%s'' to be a vector, got matrix of size %s',inputname(1), toString(size(A)))); + assert(length(A) == l, sprintf('Expected ''%s'' to have length %d, got %d', inputname(1), l, length(A))); +end