wolffd@0: function assertBNT(pred, str) wolffd@0: % ASSERT Raise an error if the predicate is not true. wolffd@0: % assert(pred, string) wolffd@0: wolffd@0: if nargin<2, str = ''; end wolffd@0: wolffd@0: if ~pred wolffd@0: s = sprintf('assertion violated: %s', str); wolffd@0: error(s); wolffd@0: end