# cell mean from each cells

8 vues (au cours des 30 derniers jours)
Kuang-Yu WANG le 26 Juin 2018
Commenté : Walter Roberson le 26 Juin 2018
I need to get the result like this
mean(cellfun(@(x) x(1,4), thething))
mean(cellfun(@(x) x(2,4), thething))
....
mean(cellfun(@(x) x(n,4), thething))
however my cell are
thething = {26*7 double}
{33*7 double}
{100*7 double}
.....{22*7 double}
not all cells have n lines.I need to use the cells that do have datas to calculate the means to form a plot. thanks!
##### 3 commentairesAfficher 2 commentaires plus anciensMasquer 2 commentaires plus anciens
Walter Roberson le 26 Juin 2018

Connectez-vous pour commenter.

### Réponses (1)

KL le 26 Juin 2018
It doesn't matter how many lines each cell has. Probably you want something like,
C = {rand(50,7),rand(30,7),rand(100,7)}; %example
C_means = cellfun(@mean,C,'uni',0)
##### 0 commentairesAfficher -1 commentaires plus anciensMasquer -1 commentaires plus anciens

Connectez-vous pour commenter.

### Catégories

En savoir plus sur Startup and Shutdown 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