Calculating a mean (from the final value, in a specific column, in a cell)

4 views (last 30 days)
Hi
I have a 155x1 cell named “particles”
Each of the 155 cells has an x by 6 double where x varies
I need only the last value in the 6th column in each of the 155
And then to find an average of these values
Is there a way to do this ??
I’m very new to matlab and have no idea what I’m doing, sorry if I’m not using the correct terms

Accepted Answer

Matt J
Matt J on 6 Feb 2018
Edited: Matt J on 6 Feb 2018
mean(cellfun(@(c) c(end,6),particles))

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!