フィルターのクリア

a question about the for loop index

1 回表示 (過去 30 日間)
Mnr
Mnr 2015 年 6 月 24 日
コメント済み: Mnr 2015 年 6 月 24 日
Hello,
I would like to have a for loop with its index k ranging from e.g. 8 to 1 such that in the first iteration k=8, in the second iteration k=4, in the 3rd iteration k=2, and in the forth iteration k=1. I would appreciate your help. Thanks.

採用された回答

Matt J
Matt J 2015 年 6 月 24 日
for k=2.^(3:-1:0)
....
end
  1 件のコメント
Mnr
Mnr 2015 年 6 月 24 日
Thanks!

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

その他の回答 (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