
function err=rms(a,b)
% rms(a,b) rms difference between array a and b
[nx nz]=size(a);
n=nx*nz;
diff=sum(sum((a-b).*(a-b))) ;
f=sum(sum(a.*a)) ;
err=1/n*sqrt(diff/f);


