function vout = greville(vin,r) % Calculates the greville abscissae to the input nodes in vin % to the degree r m = length(vin); for k = 1:m-r vout(k) = sum(vin((k+1):(k+r-1)))/(r-1); end