repeat a matrix in defined manner
Mostrar comentarios más antiguos
hi! How could i generate from this matrix:
A=[1 2 3
4 5 6
4 5 6]
this matrix:
B= [1 1 1 1 2 2 2 2 3 3 3 3
4 4 4 4 5 5 5 5 6 6 6 6
4 4 4 4 5 5 5 5 6 6 6 6]
thank you
Respuesta aceptada
Más respuestas (1)
Walter Roberson
el 12 de Dic. de 2012
Editada: Walter Roberson
el 12 de Dic. de 2012
kron(A,[1 1 1 1])
or
A(:, repmat(1:end,4,1) )
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!