Mercurial > repos > public > sbplib
diff assert_size.m @ 890:c70131daaa6e feature/d1_staggered
Merge with feature/poroelastic.
author | Martin Almquist <malmquist@stanford.edu> |
---|---|
date | Wed, 21 Nov 2018 18:29:29 -0800 |
parents | afd20f023928 |
children |
line wrap: on
line diff
--- a/assert_size.m Sun Nov 04 12:36:30 2018 -0800 +++ b/assert_size.m Wed Nov 21 18:29:29 2018 -0800 @@ -1,16 +1,5 @@ % Assert that array A has the size s. function assert_size(A,s) - errmsg = sprintf('Expected %s to have size %s, got: %s',inputname(1), format_vector(s), format_vector(size(A))); - assert(all(size(A) == s),errmsg); -end - -function str = format_vector(a) - l = length(a); - str = sprintf('[%d',a(1)); - - for i = 2:l - str = [str sprintf(', %d',a(i))]; - end - - str = [str ']']; + warning('Use assertSize() instead!') + assertSize(A,s); end \ No newline at end of file