Total data in the group

1 view (last 30 days)
Ellina
Ellina on 27 Aug 2014
Commented: Ellina on 27 Aug 2014
Can someone help me how to calculate the sum of this data.
[7 3 11 11 10 10]
that is i would like to make
  • group 7 = 1 data
  • group 3 = 1 data
  • group 11 = 2 data
  • group 10 = 2 data

Accepted Answer

dpb
dpb on 27 Aug 2014
>> d=[7 3 11 11 10 10];
>> u=unique(d);
>> [u;histc(d,u)]
ans =
3 7 10 11
1 1 2 2
>>

More Answers (0)

Categories

Find more on Get Started with MATLAB in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!