필터 지우기
필터 지우기

Finding gradient in MATLAB

조회 수: 2 (최근 30일)
Ba Ba Black Sheep!
Ba Ba Black Sheep! 2017년 1월 4일
편집: Star Strider 2017년 1월 4일
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;

채택된 답변

Star Strider
Star Strider 2017년 1월 4일
편집: Star Strider 2017년 1월 4일
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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Problem-Based Optimization Setup에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by