Findind repeated elements in a cell of a Table and report number of cases
1 次查看(过去 30 天)
显示 更早的评论
I have a table for which I would like to find how many times a certain item is repeated (for one column [variable] only at a time), and have the number of times it happens (sorted optimally). What is the way around this?
0 个评论
回答(1 个)
KSSV
2021-5-18
Let a be column.
xbins = unique(a);
[counts,centres] = hist(a,xbins);
R = [centres counts']
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Shifting and Sorting Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!