How to calculate mean across the elements of a cellarray?

7 vues (au cours des 30 derniers jours)
DEEPAK PHCSFI17041149
DEEPAK PHCSFI17041149 le 28 Déc 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.

Réponses (1)

Image Analyst
Image Analyst le 28 Déc 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.

Catégories

En savoir plus sur Matrices and Arrays dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by