function out=rms(D,P)

s = size(P);
s = s(1);

out=norm(D(1:s)-P)/sqrt(s);

