1, 4, 7, 2, 5, 8, 3, 6, 9 serie
조회 수: 102 (최근 30일)
이전 댓글 표시
Hi, at some point in my MATLAB code I need to generate the following serie of numbers 1,4,7, 2, 5, 8, 3, 6, 9 I can't find the way to please can you help me ?
Thank you !
댓글 수: 0
채택된 답변
추가 답변 (1개)
John D'Errico
2022년 9월 15일
편집: John D'Errico
2022년 9월 15일
Yes, @Tom has given a great answer. The way I would solve it on any normal day. But, just perhaps, is there another way? There always is...
ind = 0:8;
1 + 3*mod(ind,3) + floor(ind/3)
Look carefully at how it works. Take apart each piece.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Time Series Events에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!