using fsolve for real answers

4 vues (au cours des 30 derniers jours)
mona faraji
mona faraji le 21 Avr 2011
i use fsolve to solve a set of nonlinear equations with two variables, i want real, not, complex answers for initial conditions that i give.
how can i do this, because almost the answers are complex.

Réponses (2)

Sean de Wolski
Sean de Wolski le 21 Avr 2011
  1 commentaire
mona faraji
mona faraji le 25 Avr 2011
thanks for your answer, what do you mean by doc real?

Connectez-vous pour commenter.


Steve Grikschat
Steve Grikschat le 21 Avr 2011
fsolve (and all other functions in the Optimization Toolbox) are not supposed to work with complex data. You need to make sure that your system only returns real data.
If you have imaginary components to your system, then do as Sean suggested and remove them using real, to solve the problem in the real domain.

Catégories

En savoir plus sur Systems of Nonlinear Equations dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by