Effacer les filtres
Effacer les filtres

How to create a single column matrix

16 vues (au cours des 30 derniers jours)
Phoenix
Phoenix le 28 Juin 2019
Réponse apportée : Ruvimbo le 26 Août 2022
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

Réponse acceptée

Matt J
Matt J le 28 Juin 2019
repelem((1:200).',100)
  2 commentaires
Phoenix
Phoenix le 28 Juin 2019
Smart! Thanks! :)
Matt J
Matt J le 28 Juin 2019
You're welcome, but please Accept-click the answer if it resolved your question.

Connectez-vous pour commenter.

Plus de réponses (1)

Ruvimbo
Ruvimbo le 26 Août 2022
repelem((1:200).',100)

Catégories

En savoir plus sur Matrices and Arrays dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by