필터 지우기
필터 지우기

Non linear equation solution by FSOLVE command

조회 수: 1 (최근 30일)
Mohammad Yunus Ali
Mohammad Yunus Ali 2011년 3월 5일
Can anyone post a simple matlab program to solve two or three equations using fsolve function?

답변 (1개)

Walter Roberson
Walter Roberson 2011년 3월 5일
Here is one online tutorial
  댓글 수: 2
Mohammad Yunus Ali
Mohammad Yunus Ali 2011년 3월 5일
the tutorial is not helpful for me. I tried to write a code like below but its giving error. could u pls correct it?
function f=nle(x)
f(1)=x(1)-4*x(1)^2-x(1)*x(2);
f(2)=2*x(2)-x(2)^2+3*x(1)*x(2);
end
x0=[1 1];
x=fsolve('nle';x0)
Walter Roberson
Walter Roberson 2011년 3월 5일
You missed a sentence,
"Enter the initial guess
x0 = [1 1]'
Note: x0 is the TRANSPOSE of a row vector"
You did not use the transpose.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Linear Algebra에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by