how to concatenate the cell data into a single matrix?
10 次查看(过去 30 天)
显示 更早的评论

All the data samples are of same length. i need to create a matrix containing all this data. there are 327 cells like this in continuation.
3 个评论
Walter Roberson
2021-1-27
What size of output are you looking for? (3*328) by 256? Or 3 x (256*328) ? Or 3 x 256 x 328 ? Or a single vector?
采纳的回答
Walter Roberson
2021-1-28
Single_Matrix = cell2mat(cellfun(@(C) C(:), YourCell, 'uniform', 0));
However, I am concerned about whether this will work. You said twice that you have 327 cells, but your header shows that you have a 1 x 328 cell array. Is one of the cells empty and that is why you say 327 ? If so then what do you want done about the empty cell?
4 个评论
Walter Roberson
2021-1-28
Single_Matrix = cell2mat(cellfun(@(C) C(:), Interpolated_data(1:327), 'uniform', 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!