cell mean from each cells
9 次查看(过去 30 天)
显示 更早的评论
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!
回答(1 个)
KL
2018-6-26
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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Biotech and Pharmaceutical 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!