How to create a jacobian matrix for newton methods using multiple variables

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 件)

カテゴリ

ヘルプ センター および File ExchangeSymbolic Math Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by