function v=rnd(x,n)
%v is x rounded to n decimals
v=round(x*10^n)/10^n;