how can i combine arrays of different size.
4 次查看(过去 30 天)
显示 更早的评论
i have six arrays of size as given in figure.
i need to combine all arrays one after the other.
but the problem is they are of different dimenion.
how can i combine all these arrays?![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/637915/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/637915/image.png)
thanks in advance.
采纳的回答
Walter Roberson
2021-5-31
sizes = cell2mat(cellfun(@size, YourCell(:), 'uniform', 0));
maxcols = max(sizes(:,2));
combined = cell2mat(cellfun(@(M) [M, zeros(size(M,1), maxcols-size(M,2))], YourCell(:), 'uniform', 0));
0 个评论
更多回答(0 个)
另请参阅
类别
在 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!