split matrix
7 次查看(过去 30 天)
显示 更早的评论
we have matrix as 801* 3 and we need to split or divide this matrix to parts as 100 * 3 , the rest of matrix after split must be put in matrix also How ???
0 个评论
采纳的回答
Andrei Bobrov
2012-2-14
A = randi(1800,801,3);% A - Let your matrix.
A1 = A(1:end-1,:); % for this is case - size of A - [801x3]
outDouble3d = permute(reshape(A1.',3,100,[]),[2 1 3]);
or
outCell = mat2cell(A,[100*ones(fix(size(A,1)/100),1);1],3)
ADD
n = 89;
[m,k] = size(A);
t = rem(m,n);
if ~t, t = []; end
outCell = mat2cell(A,[n*ones(fix(m/n),1);t],k)
0 个评论
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!