非線形連立方程式の解法

13 Ansichten (letzte 30 Tage)
聡 渡邉
聡 渡邉 am 30 Nov. 2020
Kommentiert: Naoya am 3 Dez. 2020
fsolveの解説に下記の例題がありますが「root2d 入力引数が不足しています」のエラーが出ます。なぜでしょうか?
function F = root2d(x)
F(1) = exp(-exp(-(x(1)+x(2)))) - x(2)*(1+x(1)^2);
F(2) = x(1)*cos(x(2)) + x(2)*sin(x(1)) - 0.5;
fun = @root2d;
x0 = [0,0];
x = fsolve(fun,x0)
  1 Kommentar
Naoya
Naoya am 3 Dez. 2020
function F = root2d(x)
F(1) = exp(-exp(-(x(1)+x(2)))) - x(2)*(1+x(1)^2);
F(2) = x(1)*cos(x(2)) + x(2)*sin(x(1)) - 0.5;
を root2d.m というファイル名の mファイルとして保存し、
>> fun = @root2d;
>> x0 = [0,0];
>> x = fsolve(fun,x0)
をMATLABコマンドウィンドウ上で実行すると解が求められそうですがいかがでしょうか?

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu 非線形方程式系 finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!