How to sum up numbers into a cell?

3 次查看(过去 30 天)
Hi, I have a 100x5 cell, and each element of it contains vectors of different sizes. See pic1.
The vectors contains different numbers (pic 2). So, is it possible to sum up these numbers, so the final result would be a matrix 100x5?
I know that probably this can be done with a for loop. But is there any other solution?

采纳的回答

Alex Mcaulley
Alex Mcaulley 2019-5-7
If a is your cell array:
b = cellfun(@sum,a)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Multidimensional Arrays 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by