fsolve

조회 수: 10 (최근 30일)
Nasir Qazi
Nasir Qazi 2012년 3월 19일
댓글: ahmed elakhdar 2016년 6월 17일
% can I give two input values to fsolve , like this
X = fsolve(@eq ,(x,T))
% where x & T are input guess values which goes into eq to prove the %function =0 ) , All I need to know if I can give 2-inputs how can I %write the code in matlab for fsolve containing 2 inputs .
  댓글 수: 1
ahmed elakhdar
ahmed elakhdar 2016년 6월 17일
already i have the same problem

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

답변 (1개)

Jacob Halbrooks
Jacob Halbrooks 2012년 3월 19일
FSOLVE only accepts a one-input function. However, you can create an anonymous function and bind your second input to a particular value, and then FSOLVE will solve the system for that value. For example:
T = c; % T assigned to a constant value
x = fsolve(@(x)eq(x,T), x0)
The last example in the help for FSOLVE shows this approach.

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by