function [g,a,b,C]=gradientn(Y,X,pts)
% outputs the quadratic approximation to the function ywhose noisy
% evaluating is in Y   make sure that the pts are the ROWS of pts
[a,b,C]=quadreg(Y,X,pts);
m=size(pts,1);   
g=repmat(b',m,1)+2*pts*C;