How to averaging each each row in cell array?

Hi, Community...
I just want to ask, how to averaging each of my cell array according to the row?
i want to average dst_allfiles{1}(1), dst_allfiles{2}(1), dst_allfiles{3}(1)
then
mean(dst_allfiles{1}(2), dst_allfiles{2}(2), dst_allfiles{3}(2))
mean(dst_allfiles{1}(3), dst_allfiles{2}(3), dst_allfiles{3}(3))
............................
How to do that? Thank you....

 采纳的回答

d=cell2mat(dst_allfiles);
m=mean(d,2);

3 个评论

Alright thanks, but why use 2 in the mean func?
mean(d,1);%mean along columns
mean(d,2);%mean along rows
See mean documentation
Thank you so much, bro. You helped me so much....

请先登录,再进行评论。

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Cell Arrays 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by