What is the problem here to run this code? Can I run this code without using fsolve?

13 ビュー (過去 30 日間)
function fn=ex_sys_n(x);
fn(1)=exp(-x(1)+x(2))-x(1)^2;
fn(2)=sin(x(1))+cos(x(2));
clc; clear all;
fun=@(x) ex_sys_nl(x);
x0=[0,0];
x=fsolve(fn,x0)

採用された回答

Matt J
Matt J 2022 年 2 月 18 日
x0=[0,0];
x=fsolve(@ex_sys_n,x0)
Equation solved. fsolve completed because the vector of function values is near zero as measured by the value of the function tolerance, and the problem appears regular as measured by the gradient.
x = 1×2
0.3283 -1.8991
function fn=ex_sys_n(x);
fn(1)=exp(-x(1)+x(2))-x(1)^2;
fn(2)=sin(x(1))+cos(x(2));
end
  2 件のコメント
Akash Talapatra
Akash Talapatra 2022 年 2 月 18 日
Still, it is showing the same error. What should I correct?

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by