Replicating rows/columns within a matrix, kron function

I would like to replicate every row within a matrix a multiple of times. I tried using the kron function but I can't seem to get it to replicate the rows more than twice. As an example, I would like to go from: [3 4; 5 6] to [3 4; 3 4; 3 4; 5 6; 5 6; 5 6]
Any help would be greatly appreciated.
Thanks!

 Respuesta aceptada

kron([3 4; 5 6],ones(3,1))

3 comentarios

Perry
Perry el 27 de En. de 2012
Awesome. Thank you!
Thank you!!! exactly what I was looking for!!!!
Note that this answer is old. You should now use repelem in more modern releases.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Networks en Centro de ayuda y File Exchange.

Preguntada:

el 27 de En. de 2012

Comentada:

el 4 de Oct. de 2017

Community Treasure Hunt

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

Start Hunting!

Translated by