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.
我有一个15276x30991矩阵,我想将它拆分为3更小的矩阵,我知道我必须使用mat2cell函数,但我无法正确设置尺寸。您能帮我解决一下如何实现这一目标吗?
15276x30991
3
mat2cell
示例对于300x25要拆分10为维度矩阵的矩阵30x25应该是
300x25
10
30x25
Mcell = mat2cell(A,repmat(30,10,1),25)
要将矩阵沿行拆分为三个矩阵,请尝试:
>> x = rand(15276,100); >> C = mat2cell(x, ones(3,1)*(size(x,1)/3), size(x,2)) C = [5092x100 double] [5092x100 double] [5092x100 double]
这假设它size(x,1)可以被 3 整除,这在您的情况下是正确的:15276/3 = 5092
size(x,1)
15276/3 = 5092