How to sum up numbers into a cell?

1 回表示 (過去 30 日間)
ARGY B
ARGY B 2019 年 5 月 7 日
コメント済み: ARGY B 2019 年 5 月 7 日
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)
  1 件のコメント
ARGY B
ARGY B 2019 年 5 月 7 日
Thank you :)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMultidimensional Arrays についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by