transfering the one row matrix into multiple row matrix with the same data

How can I transfer the one row matrix A into multiple row matrix A' with the same data just like below:
A=[3 0 0 0 2 8 1 0 4]
A' = [3 0 0;0 2 8; 1 0 4]

 採用された回答

Stephen23
Stephen23 2016 年 7 月 11 日
編集済み: Stephen23 2016 年 7 月 11 日
You can use reshape and transpose:
>> A = [3,0,0,0,2,8,1,0,4];
>> reshape(A,3,3).'
ans =
3 0 0
0 2 8
1 0 4

その他の回答 (0 件)

カテゴリ

製品

質問済み:

2016 年 7 月 11 日

編集済み:

2016 年 7 月 11 日

Community Treasure Hunt

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

Start Hunting!

Translated by