Mercurial > repos > public > sbplib
diff assert_size.m @ 797:5cf9fdf4c98f feature/poroelastic
Merge with feature/grids and bugfix bcSetup
author | Martin Almquist <malmquist@stanford.edu> |
---|---|
date | Thu, 26 Jul 2018 10:53:05 -0700 |
parents | afd20f023928 |
children |
line wrap: on
line diff
--- a/assert_size.m Wed Jul 25 18:53:07 2018 -0700 +++ b/assert_size.m Thu Jul 26 10:53:05 2018 -0700 @@ -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