how can we calculate the hessian matrix in general ?
Afficher commentaires plus anciens
is there any clear way for calculating the hessian matrix of a complex equation? for example in QP problems we have to change the form of our equation to form of quadprog() function. how can we calculate the matrix H and f in quadprog in general. i asked similar question before in this link: http://www.mathworks.com/matlabcentral/answers/234018-please-solving-this-qp-equation but i cant understand the answers ... please answer my question in detail
Réponse acceptée
Plus de réponses (1)
I think answer to you question is hessian function.
If you have function y=x1^2+2*x1*x2+x2^2
and you want to represent y in form of y=x*H*x',
where x=[x1 x2],
then apply:
syms x1 x2
y=x1^2+2*x1*x2+x2^2
H=1/2.*hessian(y)
1 commentaire
Matt J
le 8 Nov 2019
Note that this won't be practical with a large number (e.g., 100, 1000) of unknown x(i). The Symbolic Math Toolbox unfortunately does not support symbolic manipulation of vector variables.
Catégories
En savoir plus sur Quadratic Programming and Cone Programming dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!