cell mean from each cells

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 件のコメント

Kuang-Yu WANG
Kuang-Yu WANG 2018 年 6 月 26 日
sorry i entered the wrong code orz
Walter Roberson
Walter Roberson 2018 年 6 月 26 日
Walter Roberson
Walter Roberson 2018 年 6 月 26 日
Please do not close questions that have an answer.

サインインしてコメントする。

回答 (1 件)

KL
KL 2018 年 6 月 26 日

0 投票

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)

カテゴリ

ヘルプ センター および File ExchangeGraphics Performance についてさらに検索

製品

質問済み:

2018 年 6 月 26 日

コメント済み:

2018 年 6 月 26 日

Community Treasure Hunt

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

Start Hunting!

Translated by