function [xd]=strnd(x,n)
% function to produce string of a number rounded to specified decimal places
spec = ['%0.' num2str(n) 'f'];
xd = sprintf(spec,x);