How to stack columns in a matrix?

33 ビュー (過去 30 日間)
Rijul Chauhan
Rijul Chauhan 2022 年 3 月 31 日
回答済み: Voss 2022 年 3 月 31 日
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!

回答 (1 件)

Voss
Voss 2022 年 3 月 31 日
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

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by