Borrar filtros
Borrar filtros

Finding gradient in MATLAB

2 visualizaciones (últimos 30 días)
Ba Ba Black Sheep!
Ba Ba Black Sheep! el 4 de En. de 2017
Editada: Star Strider el 4 de En. de 2017
If the gradient of
100*(y - x^2)^2 + (1 - x)^2
is,
[-400*(y - x^2)*x - 2*(1 - x); 200*(y - x^2)]
what would be the gradient of
(1 - x + a)^2 + 100*(y - b - (x-a)^2)^2;

Respuesta aceptada

Star Strider
Star Strider el 4 de En. de 2017
Editada: Star Strider el 4 de En. de 2017
syms a b x y
J = jacobian( (1 - x + a)^2 + 100*(y - b - (x-a)^2)^2, [x,y])
G = gradient( (1 - x + a)^2 + 100*(y - b - (x-a)^2)^2, [x,y])
J =
[ 2*x - 2*a - 200*(2*a - 2*x)*(b - y + (a - x)^2) - 2, 200*y - 200*b - 200*(a - x)^2]
G =
2*x - 2*a - 200*(2*a - 2*x)*(b - y + (a - x)^2) - 2
200*y - 200*b - 200*(a - x)^2

Más respuestas (0)

Categorías

Más información sobre Problem-Based Optimization Setup en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by