annotate assertLength.m @ 1198:2924b3a9b921 feature/d2_compatible

Add OpSet for fully compatible D2Variable, created from regular D2Variable by replacing d1 by first row of D1. Formal reduction by one order of accuracy at the boundary point.
author Martin Almquist <malmquist@stanford.edu>
date Fri, 16 Aug 2019 14:30:28 -0700
parents 1d70f29c7ab2
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
987
1d70f29c7ab2 Add assertLength
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
1 function assertLength(A,l)
1d70f29c7ab2 Add assertLength
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
2 assert(isvector(A), sprintf('Expected ''%s'' to be a vector, got matrix of size %s',inputname(1), toString(size(A))));
1d70f29c7ab2 Add assertLength
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
3 assert(length(A) == l, sprintf('Expected ''%s'' to have length %d, got %d', inputname(1), l, length(A)));
1d70f29c7ab2 Add assertLength
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
4 end