필터 지우기
필터 지우기

How to create a single column matrix

조회 수: 16 (최근 30일)
Phoenix
Phoenix 2019년 6월 28일
답변: Ruvimbo 2022년 8월 26일
Hi,
How can I create a single column matrix based on this
1 (one hundred of ones)
1
1
1
.
.
.
1 (last 1 which is the 100th one)
2 (one hundred of twos)
.
.
.
.
until
200
that is 100 ones, 100 twos, 100 threes, 100 fours.... until 100 twohundreds
Basically, I need numbers from 1 to 200 on an interval of 1 --> like 1:1:200. However, I need to repeat per interval one hundred times before moving on to the next interval.
Overall, it's gonna be a 20000x1 matrix
Thanks

채택된 답변

Matt J
Matt J 2019년 6월 28일
repelem((1:200).',100)
  댓글 수: 2
Phoenix
Phoenix 2019년 6월 28일
Smart! Thanks! :)
Matt J
Matt J 2019년 6월 28일
You're welcome, but please Accept-click the answer if it resolved your question.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Ruvimbo
Ruvimbo 2022년 8월 26일
repelem((1:200).',100)

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by