function p = approxeq(a, b, thresh)
%
% p = approxeq(a, b, thresh)
% Are a and b approximately equal (to within thresh of each other, defaults to 1e-3)?

if nargin==2, thresh = 1e-3; end

p = ~(any(abs(a(:)-b(:)) > thresh));
