Replace the elements of a matrix
Mostrar comentarios más antiguos
Hello everyone,
I have an A matrix as
A=[a b ; c d ; e f ; g h]
and want to get B matrix as
B=[a ; b; c; d; e; f; g; h]
using A matrix. How can I code it? Thanks
Respuesta aceptada
Más respuestas (2)
TADA
el 9 de Jun. de 2019
B = reshape(A',numel(A),1)
1 comentario
Walter Roberson
el 9 de Jun. de 2019
A' is only correct for real valued entries, as it is the conjugate transpose.
Walter Roberson
el 9 de Jun. de 2019
B = reshape(A.',[],1);
Categorías
Más información sobre Matrices and Arrays 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!