I have a cell array filled with elements of
C=
[541x541x3 uint8]
[541x541x3 uint8]
[541x541x3 uint8]
[541x541x3 uint8]
I am trying to figure out how to add the four arrays together so that the final sum is of the form
[541x541x3 uint8]
Literally typing out C{1} + C{2} + ... (and so on) will work, but I need this process to be automated and to work for any sized cell. Any help would be appreciated!

1 件のコメント

Cedric
Cedric 2014 年 7 月 1 日
I deleted my answer because when I wrote it I didn't realize that the sum should be uint8 as well.

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

 採用された回答

Sara
Sara 2014 年 7 月 1 日

1 投票

If all the cells are consistent:
mysum = C{1};
for i = 2:numel(C)
mysum = mysum + C{i};
end

1 件のコメント

Michael
Michael 2014 年 7 月 1 日
Exactly what I wanted! Thank you!

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeOperators and Elementary Operations についてさらに検索

タグ

質問済み:

2014 年 7 月 1 日

コメント済み:

2014 年 7 月 1 日

Community Treasure Hunt

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

Start Hunting!

Translated by