Build 2-D array with same 1-D array
Mostrar comentarios más antiguos
I want to build a 2-D array with the same 1-D array. To say:
1-D array: [1 2 3 4 5 6]
to build a 2-D array like [1 2 3 4 5 6; 1 2 3 4 5 6; 1 2 3 4 5 6; 1 2 3 4 5 6; ...; 1 2 3 4 5 6;]
The total number of rows is determined by me. Is there any easy functions to implement to achieve this instead of using for loop?
Respuesta aceptada
Más respuestas (1)
Walter Roberson
el 7 de Mzo. de 2016
0 votos
repmat()
1 comentario
Renyuan Zhang
el 8 de Mzo. de 2016
Categorías
Más información sobre Matrix Indexing 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!