How to create a jacobian matrix for newton methods using multiple variables
조회 수: 17 (최근 30일)
이전 댓글 표시
I am trying to create a jacobian matrix using the equations
f1= x^2 +2x+2y^2-26 and f2=2x^3-y^2+4y-19
I haven't seen other codes that use more of the same variable (x^2, 2x) per equation, usually it's one x and one y variable. Does anyone have any advice or ideas on how to create the matrix?
댓글 수: 0
채택된 답변
Walter Roberson
2015년 10월 19일
If you have the symbolic toolbox, then
syms x y
f1 = x^2 +2*x+2*y^2-26
f2 = 2*x^3-y^2+4*y-19
jacobian([f1, f2], [x,y])
If you do not have the symbolic toolbox then you will need to do the computations the usual way,
[diff(f1,x), diff(f1, y); diff(f2, x), diff(f2, y)]
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!