%  A simple quadratic example
%
%
   function val = quad(x)
%
   M = reshape([2 1 0 1 4 3 0 3 5],3,3); c = [1 1 1];
%
   v = x(:);
   val = v'*M*v/2; + c*v;
%
% return
%
