Added EQUALITY for MATLAB tests

release/4.3a0
Frank Dellaert 2011-11-04 00:27:43 +00:00
parent cbd6446bd7
commit 28415ee219
1 changed files with 12 additions and 0 deletions

12
tests/matlab/EQUALITY.m Normal file
View File

@ -0,0 +1,12 @@
function EQUALITY(name,A,B,tol)
% test equality of two vectors/matrices up to tolerance
if nargin<4,tol=1e-9;end
assertion = size(A)==size(B);
if assertion
assertion = all(abs(A-B)<tol);
end
if (assertion~=1)
error(['EQUALITY ' name ' fails']);
end