iterative when have Loop
조회 수: 6 (최근 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!