%function val = approximate(val)
%function val = approximate(val,n)
%  rounds away from zero to the nearest 10^n
%  n defaults to 1
function val = approximate(val,n)
if nargin == 1, n = 1; end
scale = 10^n;
if val >= 0, val = scale*ceil(val/scale);
else val = scale*floor(val/scale); end