Iteration Involving 1x4 matrix

5 ビュー (過去 30 日間)
lvenG
lvenG 2021 年 10 月 17 日
コメント済み: Jan 2021 年 10 月 20 日
Hello... Would like to ask the proper procedure for iteration. Say instance below
Given P: Pgiven = [2.42 4.52 10.01 15.32]
rho=function of eta (1x4 matrix)
Z=function of eta and rho (1x4 matrix)
P=function of eta, rho and Z (1x4 matrix)-----> the P that should be calculated here needs to be equal the Pgiven
Step 1. Assumption of eta
Step 2. Calculation of rho
Step 3. Calculation of Z
Step 4. calculation of P---> end of iteration 1
What function in matlab would allow to automatically iterate until it reached an eta that provides the calculated P be equal to Pgiven?
Thank u so much!

採用された回答

Jan
Jan 2021 年 10 月 17 日
while abs(P - Pgiven) > 1e-6
...
end
  6 件のコメント
lvenG
lvenG 2021 年 10 月 20 日
Hi Jan, thank you so much for explaining and thank you so much for helping me, there really is so much to learn and am glad this community is in for some enlightenment. Now my code is proceeding to run... Have a good day!
Jan
Jan 2021 年 10 月 20 日
You are welcome.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by