MATLAB: Adding same size cell arrays

cell arraysvectorization

Assume I have a matrices C1,C2 as follows:
C1 = nx1 cell each cell is [5x5 double].
C2 = nx1 cell each cell is [5x5 double].
How to calculate C3 as:
C3{1,1} = C1{1,1}+C2{1,1};
C3{2,1} = C1{2,1}+C2{2,1};
.
.
C3{n,1} = C1{n,1}+C2{n,1};
using cellfun or any other method without looping

Best Answer

cellfun(@plus,A,B,'uni',0)
cell2mat(A)+cell2mat(B)