"Matt J " <mattjacREMOVE@THISieee.spam> wrote in message <ido5jk$8bm$1@fred.mathworks.com>...
> "stephen " <sca2c@virginia.edu> wrote in message <idmk5k$5vv$1@fred.mathworks.com>...
> > I have a very long function I want to use in fmincon. This is my first post so I don't know the best way to state the function but I will attempt it like this:
> =======
>
> This is a quadratic function, so you should probably consider using QUADPROG, as opposed to FMINCON. Depends on your constraints, I guess.
And, if QUADPROG turns out to be applicable, you may also want to look at the HessMult option for large scale algorithms. The case you initially described (without "coefficients") has a Hessian of H=ones(120). The product H*Y (cf. also Roger's post) can be more efficiently implemented as
e=ones(120,1);
hmfun=@(Hinfo,Y) e*sum(Y,1);
