about summary refs log tree commit diff
path: root/sourcecodes/bnt-master/KPMtools/assertBNT.m
blob: 2d0cf960ed791d51b39b679c895aecb39e7d735f (plain)
1
2
3
4
5
6
7
8
9
10
function assertBNT(pred, str)
% ASSERT Raise an error if the predicate is not true.
% assert(pred, string)

if nargin<2, str = ''; end

if ~pred
  s = sprintf('assertion violated: %s', str);
  error(s);
end