I have A(21,147) matrix.i need to create a loop for column of matrix A.this column ranges only a weekly period and i want to achieve that 21 column and each ones sequence start from 1 to 7. How can I do that ?

回答 (1 件)

Stephen23
Stephen23 2018 年 7 月 30 日
編集済み: Stephen23 2018 年 7 月 30 日

0 投票

>> vec = 1:21;
>> 1+mod(vec(:)-1,7)
ans =
1
2
3
4
5
6
7
1
2
3
4
5
6
7
1
2
3
4
5
6
7

カテゴリ

ヘルプ センター および File Exchange で Loops and Conditional Statements についてさらに検索

質問済み:

2018 年 7 月 30 日

編集済み:

2018 年 7 月 30 日

Community Treasure Hunt

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

Start Hunting!

Translated by