Command to reshape matrix diagonally
Mostrar comentarios más antiguos
Hi, i'd like to transform
X = 1 100 40
2 107 30
3 90 50
4 120 60
into
Y = 1 100 40 3 90 50
2 107 30 4 120 60
I thought
Y = reshape(X,2,6)
would do the trick but it didn't give me the matrix I was looking for.
Any quick ideas will be appreciated.
Thanks!
Respuesta aceptada
Más respuestas (1)
Rick Rosson
el 8 de Abr. de 2016
Y = [ X(1:end/2,:) X(end/2+1:end,:) ];
1 comentario
fr_sk
el 8 de Abr. de 2016
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!