2013-10-24 96 views
0

我不认为我知道在Matlab中使用repmat的技巧。我尝试了一些组合,我无法实现我所需要的。Matlab:从矢量创建3D数组

我有一个大小为1 x 20的向量A.我只是想堆栈A来创建3 x 5 x 20大小的矩阵。你能帮忙吗?

+0

请不得不通过看[本教程(http://www.mathworks.com/academia/student_center/tutorials/launchpad.html)和[本文档'repmat'(HTTP:// www.mathworks.com/help/matlab/ref/repmat.html)。 – chappjc

回答

2
A = 1:20; 
reshape(repmat(A, [15, 1]), [3,5,20])