function EQUALITY(name,expected,actual,tol) % test equality of two vectors/matrices up to tolerance if nargin<4,tol=1e-9;end sameSize = size(expected)==size(actual); if all(sameSize) equal = abs(expected-actual)