Group means- Large Data
1 view (last 30 days)
I am trying to get grouped means similar to the following example. I have only know of the following two methods. I have a large data set and have to repeat this command a large number of times so I am concerned about speed. Are there any quicker methods? Thanks for any help!
%Method 1: Groupstats
%Method 2: Logical Indexing
John D'Errico on 29 Sep 2015
Edited: John D'Errico on 29 Sep 2015
On my cpu, here were the times reported for your two solutions.
Elapsed time is 0.005852 seconds.
Elapsed time is 0.004096 seconds.
So I tried consolidator (from the file exchange.)
[~,meantest3] = consolidator(x(:,1),x(:,2:100),@mean);
Elapsed time is 0.002943 seconds.
It has been around for a while, but still pretty fast.