Total data in the group

2 次查看(过去 30 天)
Ellina
Ellina 2014-8-27
评论: Ellina 2014-8-27
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

采纳的回答

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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by