How to calculate mean across the elements of a cellarray?

8 visualizaciones (últimos 30 días)
DEEPAK PHCSFI17041149
DEEPAK PHCSFI17041149 el 28 de Dic. de 2017
Respondida: Image Analyst el 28 de Dic. de 2017
I have a cellarray A of dimension 64x8 with elements in the following dimension,
520x1 double 520x1 double 520x1 double 520x1 double 520x1 double 520x1 double 520x1 double 520x1 double
520x1 double 520x1 double 520x1 double 520x1 double 520x1 double 520x1 double 520x1 double 520x1 double
520x1 double 520x1 double 520x1 double 520x1 double 520x1 double 520x1 double 520x1 double 520x1 double
...............
Now i need to take MEAN across the 8 rows in each column, so that i will get just one 520x1 cell per row.
so, after applying mean across rows, my output should be something like,
520x1 double
520x1 double
520x1 double
520x1 double
520x1 double
520x1 double
............
............
So, my output would be a 64x1 cell array transformed from 64x8.
i tried with doing this with the following command,
avgCell = {mean(cat(3,C{:}),3)}
But, it gives 1x1 cell array with just one cell of dimension 520x1.
Kindly correct me, and suggest me if there is any function to deal with this.

Respuestas (1)

Image Analyst
Image Analyst el 28 de Dic. de 2017
Try using cell2mat(), then mean(). Attach your cell array in a .mat file with the paper clip icon if you can't figure it out.

Categorías

Más información sobre Matrices and Arrays en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by