Writing a Matrix 6x6 in one line

63 vues (au cours des 30 derniers jours)
Leonardo Barbosa Torres dos Santos
Dear,
I have a Matrix 6x6,, for example:
A = \begin{bmatrix}
1 & 2 & 3 & 4 & 5 & 6 \\
7 & 8 & 9 & 10 & 11 & 12\\
13 & 14 & 15 & 16 &17 & 18\\
19 & 20 &21 & 22 & 23 &24 \\
25& 26 & 27 & 28 &29 &30 \\
31& 32 & 33 & 34 & 35 & 36
\end{bmatrix}
I would like to write the matrix A6x6 in a line and 36 column, that is (1,36).
For example:
A = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36]

Réponse acceptée

Adam
Adam le 4 Avr 2019
Modifié(e) : Adam le 4 Avr 2019
A = 1:36;
I may be misunderstanding the question, but if not then it would seem to be that simple?
or
A = A(:)';
if you are starting out with your 6x6 matrix, more generically.
  1 commentaire
Leonardo Barbosa Torres dos Santos
Thank you very much. It works !! \o/

Connectez-vous pour commenter.

Plus de réponses (1)

Jos (10584)
Jos (10584) le 4 Avr 2019
help reshape

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by