MATLAB: Mean value of equal cells

mean cell

I have a 2 x 9 cell:
29×1 double 22×1 double 22×1 double 22×1 double 22×1 double 22×1 double 22×1 double 24×1 double 34×1 double
1×40 double 1×40 double 1×40 double 1×40 double 1×40 double 1×40 double 1×40 double 1×40 double 1×40 double
I want to take the mean of all the 1×40 doubles (so the second row and all the columns) of this cells and have the result of a 1×40 mean double.
How to do this?

Best Answer

Let X - your cell array (2 x 9):
out = mean(cat(1,X{2,:}));