how can I convert a matrix to an array

350 vues (au cours des 30 derniers jours)
Vishnu M S
Vishnu M S le 16 Jan 2013
Commenté : Berk Kucukoglu le 18 Fév 2022
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 commentaire
José-Luis
José-Luis le 16 Jan 2013
Modifié(e) : José-Luis le 16 Jan 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.

Connectez-vous pour commenter.

Réponse acceptée

Thorsten
Thorsten le 16 Jan 2013
Modifié(e) : Thorsten le 16 Jan 2013
B = A';
B = B(:)';
  1 commentaire
Berk Kucukoglu
Berk Kucukoglu le 18 Fév 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? :)

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by