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

2 次查看(过去 30 天)
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 个)

类别

Help CenterFile Exchange 中查找有关 Matrices and Arrays 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by