Total number of zeros , ones , twos..etc in a matrix

10 次查看(过去 30 天)
I have a matrix where in the fourth column there will be numbers of 0 to 23. I need a separate matrix where there will be the total numbers of 0s, 1s,2s ..23s etc. Say there will be 1000 0s, 3000 1s 24000 11s etc.
  2 个评论
Walter Roberson
Walter Roberson 2020-12-9
编辑:Walter Roberson 2020-12-9
accumarray() together with findgroups(). Or use groupcounts()
I will not post code as I have a suspicion this is homework.

请先登录,再进行评论。

采纳的回答

KSSV
KSSV 2020-12-9
Let a be your data array.
[count_unique, unique_a] = hist(a,unique(a)) ;

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Multidimensional Arrays 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by