combining 5 rows into one matrix
5 次查看(过去 30 天)
显示 更早的评论
How do I combine 5 different (1x10) vectors into a single matrix of dimension 5x10
0 个评论
回答(2 个)
Cris LaPierre
2020-12-6
mat1=1:10;
mat2=11:20;
mat3=21:30;
mat4=31:40;
mat5=41:50;
% Combine using square brackets and transpose to make 5x10
newMat = [mat1; mat2; mat3; mat4; mat5]'
VBBV
2022-7-20
mat1=1:10;
mat2=11:20;
mat3=21:30;
mat4=31:40;
mat5=41:50;
% transpose is not required to make 5x10
newMat = [mat1; mat2; mat3; mat4; mat5]
transpose is not necessary
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!