using for loop to create a vector

2 ビュー (過去 30 日間)
Thun Htet Tun Than
Thun Htet Tun Than 2021 年 2 月 23 日
回答済み: Tesfaye Girma 2021 年 2 月 23 日
How can I use for loop command to assign a value to an odd or even element of the index?
"M" "T" "W" "Th" "F" "Sa" "Su"
"30" "45" "30" "0" "90" "45" "30"
It will look something like this. at the same time, I want to produce a result that is divisible by 7 so that the number of week is complete no matter the number of days i entered.

回答 (1 件)

Tesfaye Girma
Tesfaye Girma 2021 年 2 月 23 日
for weeks = "M" "T" "W" "Th" "F" "Sa" "Su";
days="30" "45" "30" "0" "90" "45" "30"
disp(weeks)=odd

カテゴリ

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