Filter löschen
Filter löschen

How to calculate mean across the elements of a cellarray?

3 Ansichten (letzte 30 Tage)
DEEPAK PHCSFI17041149
DEEPAK PHCSFI17041149 am 28 Dez. 2017
Beantwortet: Image Analyst am 28 Dez. 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.

Antworten (1)

Image Analyst
Image Analyst am 28 Dez. 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.

Kategorien

Mehr zu Matrices and Arrays finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by