matrix manipulation, maybe repmat?
Mostrar comentarios más antiguos
I have a huge matrix, just to make the case simple
Say I have a =
1 4 7 10
2 5 8 11
And I would like to get: a =
1 4 7 10
1 4 7 10
2 5 8 11
2 5 8 11
Is there a smart way of doing that(without loop)?
Thanks in advance!!
2 comentarios
Oleg Komarov
el 13 de Jul. de 2011
5000 * 4 * (8 bytes) = 0.152587891 megabytes: not so huge.
Zoe Zhang
el 13 de Jul. de 2011
Respuesta aceptada
Más respuestas (1)
bym
el 13 de Jul. de 2011
a =
1 4 7 10
2 5 8 11
>> b = a([1,1,2,2],:)
b =
1 4 7 10
1 4 7 10
2 5 8 11
2 5 8 11
3 comentarios
Zoe Zhang
el 13 de Jul. de 2011
Zoe Zhang
el 13 de Jul. de 2011
Andrei Bobrov
el 14 de Jul. de 2011
reshape(permute(a(:,:,[1 1]),[2 3 1]),[],4)'
Categorías
Más información sobre Matrix Indexing en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!