非線形連立方程式の解法

13 views (last 30 days)
聡 渡邉
聡 渡邉 on 30 Nov 2020
Commented: Naoya on 3 Dec 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 Comment
Naoya
Naoya on 3 Dec 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コマンドウィンドウ上で実行すると解が求められそうですがいかがでしょうか?

Sign in to comment.

Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!