iterative when have Loop

4 views (last 30 days)
Salam Al-Rubaye
Salam Al-Rubaye on 2 Oct 2019
Commented: Salam Al-Rubaye on 7 Oct 2019
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 Comment
Kevin Phung
Kevin Phung on 2 Oct 2019
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

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 2 Oct 2019
Edited: Walter Roberson on 2 Oct 2019
Put the code into a function that returns the sum of the three values, and then fzero() or fsolve() .

More Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Tags

Products

Community Treasure Hunt

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

Start Hunting!