How to stack columns in a matrix?

7 vues (au cours des 30 derniers jours)
Rijul Chauhan
Rijul Chauhan le 31 Mar 2022
Réponse apportée : Voss le 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!

Réponses (1)

Voss
Voss le 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

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by