How to stack columns in a matrix?

43 visualizzazioni (ultimi 30 giorni)
Rijul Chauhan
Rijul Chauhan il 31 Mar 2022
Risposto: Voss il 31 Mar 2022
Hello all,
So I have a xyz coordinate matrix in the following format:
A = [x y z x y z x y z ...];
How do I convert it to look like:
B = [x y z;
x y z;
x y z;
...
...
...]
Thank you!

Risposte (1)

Voss
Voss il 31 Mar 2022
A = 1:12
A = 1×12
1 2 3 4 5 6 7 8 9 10 11 12
B = reshape(A,3,[]).'
B = 4×3
1 2 3 4 5 6 7 8 9 10 11 12

Categorie

Scopri di più su Matrices and Arrays in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by