  function [omega,x] = wCompNC(a,b,m,n);
%
% Pre:
%   m   integer with 2<=m<=11
%   n   positive integer
%
% Post:
%   omega   column vector of weights for the composite m-point 
%           Newton-Cotes rule with n equal-length subintervals 
%           across [a,b]
%   x       column vector of abscissas.
% 
   N = n*(m-1)+1;
   x = linspace(a,b,N)'; 
   w = WNC(m);    
   omega = zeros(N,1);
   for k=1:(m-1):N-m+1
      omega(k:k+m-1) = omega(k:k+m-1) + w;
   end
   omega = omega/n;

  return
end

