using fsolve for real answers
4 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
回答(2 个)
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.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Systems of Nonlinear Equations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!