using fsolve for real answers

4 ビュー (過去 30 日間)
mona faraji
mona faraji 2011 年 4 月 21 日
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.

回答 (2 件)

Sean de Wolski
Sean de Wolski 2011 年 4 月 21 日
  1 件のコメント
mona faraji
mona faraji 2011 年 4 月 25 日
thanks for your answer, what do you mean by doc real?

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


Steve Grikschat
Steve Grikschat 2011 年 4 月 21 日
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.

カテゴリ

Help Center および File ExchangeSystems of Nonlinear Equations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by