omment rearranger une matrce long en une seul ligne

1 Ansicht (letzte 30 Tage)
alize beemiel
alize beemiel am 30 Nov. 2023
Kommentiert: alize beemiel am 30 Nov. 2023
hello
i have a long matrix with over 1000 line and 2 column
exemple
A=[16 3
5 10
9 6
4 15
2 13
11 8
7 12
14 1]
and i want restrut my matrix like this
b=[ 16 3 5 10 9 6 4 15 2 13 11 8 7 12 14 1]
some help please

Akzeptierte Antwort

Dyuman Joshi
Dyuman Joshi am 30 Nov. 2023
A=[16 3
5 10
9 6
4 15
2 13
11 8
7 12
14 1];
B = reshape(A.', 1, [])
ans = 1×16
16 3 5 10 9 6 4 15 2 13 11 8 7 12 14 1

Weitere Antworten (0)

Kategorien

Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by