%
% VDMSC Scaling of Vandermonde matrices 
%   V0 = original Vandemonde matrix with node vector x
%   VR = row-scaled Vandermonde matrix V0 with scale factor R
%
function c=VdMsc(R,n,x)
V0=zeros(n); dr=zeros(n,1); 
for i=1:n
  for j=1:n
    V0(i,j)=x(j)^(i-1);
  end
end
for i=1:n
  dr(i)=1/R^(i-1);
end
Dr=diag(dr);
Vr=Dr*V0;
s=svd(Vr);
if sum(abs(imag(s)))~=0
  s
  error('complex singular values')
  return
end
c=sqrt(sum(s.^2)*sum(s.^(-2)));
