How to create a returning loop until a condition is met?

4 ビュー (過去 30 日間)
rafe brooks
rafe brooks 2021 年 1 月 7 日
コメント済み: Cris LaPierre 2021 年 1 月 10 日
So, i have a large loop that is calculating values for 4 variables (JH,IJH,DIS,MXP) that all produce a matrix of (1,40). once it has looped round the entire set of values and completed all 4 matrix I want to find the means on each. How do i create a loop that continues until all the matrix are finished before starting the next step?

回答 (1 件)

Cris LaPierre
Cris LaPierre 2021 年 1 月 7 日
This is what a while loop is for. It continues looping as long as the test condition is true.
  2 件のコメント
rafe brooks
rafe brooks 2021 年 1 月 10 日
yeah i thought that. Ive been trying to formaulate a while statement but cant seem to crack it. Basically I am wanting to keep lopping round until the MXP vector is (1,42) but I cant find a way to write it
Cris LaPierre
Cris LaPierre 2021 年 1 月 10 日
while length(MXP)<42
...
end

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

カテゴリ

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