Converge a 1x30 row vector to a 3x10 matrix
4 次查看(过去 30 天)
显示 更早的评论
Suppose I have the following
z = [1:30]
Now I want to create a 3x 10 matrix. Where the entries in the first row are the first 10 values. In the second row entries 11:20 and in the third row 21:30
2 个评论
采纳的回答
Wietze Zijpp
2022-4-5
编辑:Torsten
2022-4-5
1 个评论
Voss
2022-4-6
"the entries in the first row are the first 10 values. In the second row entries 11:20 and in the third row 21:30"
If you want the order like that, you have to do it differently:
z = 1:30;
mymat = reshape(z,3,10)
mymat = reshape(z,10,3).'
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrices and Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!