フィルターのクリア

how to change the increment in for loop?

3 ビュー (過去 30 日間)
Sarah A
Sarah A 2018 年 8 月 1 日
編集済み: madhan ravi 2018 年 8 月 2 日
Hello,
I have this line of code in C++ and I need to know its equivalent in Matlab:
for (i =0 , i<100 , i=i+4)
?

採用された回答

madhan ravi
madhan ravi 2018 年 8 月 1 日
編集済み: madhan ravi 2018 年 8 月 1 日
hi, this is how you do it:
for i = 0:4:(100-1)
i
end
EXPLANATION: O IS THE STARTING POINT AND 4 IS THE INCREMENT , IT GOES ALL THE WAY UP UNTIL THE LIMIT (100-1)<=>99
  2 件のコメント
Sarah A
Sarah A 2018 年 8 月 1 日
Thank you :)
madhan ravi
madhan ravi 2018 年 8 月 2 日
編集済み: madhan ravi 2018 年 8 月 2 日
you're welcome

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

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