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