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?

채택된 답변

Walter Roberson
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개)

카테고리

Help CenterFile Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by