Azzera filtri
Azzera filtri

Finding gradient in MATLAB

2 visualizzazioni (ultimi 30 giorni)
Ba Ba Black Sheep!
Ba Ba Black Sheep! il 4 Gen 2017
Modificato: Star Strider il 4 Gen 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;

Risposta accettata

Star Strider
Star Strider il 4 Gen 2017
Modificato: Star Strider il 4 Gen 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

Più risposte (0)

Categorie

Scopri di più su Problem-Based Optimization Setup in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by