iterative when have Loop
4 次查看(过去 30 天)
显示 更早的评论
Dear,
I have to assume X and used the value in three For Loop and the sum of the results of the loops should be zero. In each loop, I have a numerical solution.
What is the best way to do iterative to Find X?
Thanks,
1 个评论
Kevin Phung
2019-10-2
can you be more clear? What do you mean by 'assume x'? It sounded like x was a constant, but then you are trying to solve for it? What are the loops doing? Provide an example for clarification
采纳的回答
Walter Roberson
2019-10-2
编辑:Walter Roberson
2019-10-2
Put the code into a function that returns the sum of the three values, and then fzero() or fsolve() .
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!