function [X, Y] = generate(N)
%GENERATE generate an input/output set.
%
%       [X, Y] = GENERATE(N) generates an Nx10 input matrix X and an Nx1
%       noisy output vector Y impementing the following function:
%
%       y = 10 sin(pi * x_1 * x_2) + 20(x_3 - 1/2)^2 + 10x_4 + 5 x_5 + n
%
%       where n is a Gaussian N(0,1) noise.
if (nargin ~= 1)
  error('GENERATE: wrong number of arguments.') ;
end

X = rand(N, 10) ;
Y = 10*sin(pi * X(:,1) .* X(:,2)) + 20*(X(:,3) - .5).^2 + 10*X(:,4) + ...
    5*X(:,5) + randn(N,1) ;
