iterative when have Loop

4 ビュー (過去 30 日間)
Salam Al-Rubaye
Salam Al-Rubaye 2019 年 10 月 2 日
コメント済み: Salam Al-Rubaye 2019 年 10 月 7 日
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
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
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() .
  1 件のコメント
Salam Al-Rubaye
Salam Al-Rubaye 2019 年 10 月 7 日
Thanks, that works.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by