Mercurial > repos > public > sbplib
diff assertLength.m @ 1197:433c89bf19e0 feature/rv
Merge with default
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Wed, 07 Aug 2019 15:23:42 +0200 |
parents | 1d70f29c7ab2 |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/assertLength.m Wed Aug 07 15:23:42 2019 +0200 @@ -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