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 MATLAB in Help Center and File Exchange

Tags

Asked:

on 27 Aug 2014

Commented:

on 27 Aug 2014

Community Treasure Hunt

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

Start Hunting!