fsolve

5 Ansichten (letzte 30 Tage)
Nasir Qazi
Nasir Qazi am 19 Mär. 2012
Kommentiert: ahmed elakhdar am 17 Jun. 2016
% 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 Kommentar
ahmed elakhdar
ahmed elakhdar am 17 Jun. 2016
already i have the same problem

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Jacob Halbrooks
Jacob Halbrooks am 19 Mär. 2012
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.

Kategorien

Mehr zu Systems of Nonlinear Equations finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by