Adding cell array values across column

1 回表示 (過去 30 日間)
AA
AA 2020 年 8 月 23 日
回答済み: Rik 2020 年 8 月 23 日
Columns 1
[ 7.669142585357160e-04]
[-1.206232786783515e-04]
[ 8.630787019556518e-04]
[-2.445883525841570e-05]
[ 9.109657363289406e-04]
Columns 2 through 4
[-1.206232786783515e-04] [3.231454899286823e-04] [150]
[ 0.001808452047926] [8.439143846238298e-04] [-40]
[-2.445883525841570e-05] [4.193099333486180e-04] [170]
[ 9.109657363289406e-04] [4.432534505352624e-04] [-20]
[-6.645138877833179e-04] [1.232259242728113e-04] [180]
Suppose I have the above cell array above. How can I get the sum of each cell array column when adding the values across the column?

採用された回答

Rik
Rik 2020 年 8 月 23 日
It looks like you can simply convert to a normal matrix (and back):
A={your_cell};
A=cell2mat(A);
A=sum(A,1);
A=num2cell(A);

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Types についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by