how can I convert a matrix to an array

I have a matrix say, A=
1 8 4 6
2 1 7 5
8 3 3 9 .
I need the elements in an array called B like B=[1 8 4 6 2 1 7 5 8 3 3 9].
Please help me.

1 comentario

José-Luis
José-Luis el 16 de En. de 2013
Editada: José-Luis el 16 de En. de 2013
Repeated question:
How did the answer you were given not solve your problem. Instead of asking a new question please explain what you actually want.
Please accept an answer if it helped you.

Iniciar sesión para comentar.

 Respuesta aceptada

Thorsten
Thorsten el 16 de En. de 2013
Editada: Thorsten el 16 de En. de 2013
B = A';
B = B(:)';

1 comentario

Berk Kucukoglu
Berk Kucukoglu el 18 de Feb. de 2022
This worked for me, therefore I upvoted. Thank you.
However, I don't understand why it works. And is it always guaranteed to work between updates? Like, is this a bug or a feature? :)

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Etiquetas

Preguntada:

el 16 de En. de 2013

Comentada:

el 18 de Feb. de 2022

Community Treasure Hunt

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

Start Hunting!

Translated by