MATLAB: How to use fsolve with constraints

constraintsfsolveMATLAB

Hi,
I am using fsolve to compute the portfolio weights of some assets.
I would like fsolve to calculate these weights with a short-selling constraint, so that any asset weight could be less than 0.
How can I do this?
Thank you very much.

Best Answer

LSQNONLIN is more or less a version of FSOLVE which supports upper and lower bound constraints. For more complicated constraints, you would need FMINCON, most likely.
It sounds like your problem actually has no constraints if the asset weights can be both positive and negative.
Related Question