Creating a sequence with repeating numbers
Mostrar comentarios más antiguos
I want to create a sequence as follows: The sequence should have a single column with each number repeated twice (1,1,2,2,3,3,4,4,....430,430)
Respuestas (1)
b = repelem(1:430,1,2)
or for a column:
b = (repelem(1:430,1,2))'
2 comentarios
Sahil Jain
el 20 de Jul. de 2019
Stephan
el 20 de Jul. de 2019
Did you notice that you can accept and/or vote for useful answers?
Categorías
Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!