Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个可能有一百万个 3x3 矩阵的数组。在不使用 for 循环的情况下,在 MATLAB 中水平连接它们的最快方法是什么?理想情况下,我想做这样简单的事情
[M(:,:,1) M(:,:,2) ... M(:,:,10000000)]
提出问题的方式是将大的 3-D 矩阵M(:,:,j)转换为连接的 2-D 矩阵。为此,只需使用reshape,例如:
M(:,:,j)
reshape
M=reshape(M,size(M,1),[]);