Using fsolve with multiple unknowns
14 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Reggie Stecher
am 17 Okt. 2020
Bearbeitet: Matt J
am 18 Okt. 2020
I'm trying to solve a system of 2 non-linear equations using fsolve with 2 uknowns.
Something like
F = @(x,y)[equation 1; equation2];
x0 = [x1,x1];
y0 = [y1,y1];
[x,y] = fsolve(F,x0,y0);
I'm familiar with using fsolve with one unknown, but unsure on the syntax for a problem like this.
0 Kommentare
Akzeptierte Antwort
Matt J
am 18 Okt. 2020
Bearbeitet: Matt J
am 18 Okt. 2020
...but unsure on the syntax for a problem like this.
The syntax does not change. It is simply that your equation expressions will be functions of a vector variable z instead of a scalar.
F = @(z)[z(1)+z(2); 2*Z(1)+z(2)^2];
[x,y] = fsolve(F,[z1,z2]);
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Symbolic Math Toolbox finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!