Is there a formula of coefficients of Newton-Cotes Method in numerical intergation? We know the coefficients of Newton-Cotes method in numerical integration are:
2-points        $ 0.5$ ,     $0.5$
3-points        $ 1/6$,    $2/3$,   $ 1/6$ 
4-points         $1/8$,     $3/8$,    $3/8$,    $1/8$
and so on
I ask if there is a formula of all coefficients in this method. 

Maybe read: http://people.clas.ufl.edu/kees/files/NewtonCotes.pdf
It presents a method easily convertible to MATLAB that can be used to generate the coefficients:
function q = NewtonCotesCoefficients(degree)

  q = 0:degree;
  m = fliplr(vander(q));
  for ii = 0: degree
    b(ii + 1) = degree^(ii + 1)/(ii + 1);
  end
  q = m'\b';
end

