Using unique-function - show amount of times unique value was found
1 次查看(过去 30 天)
显示 更早的评论
Hey,
I am using:
[C, ia, ic] = unique(Location);
Now I get a list of unique Locations in Location but am actually looking for the amount of times each location is in there. E.g.:
C Times
Location 1 5
Location 2 8
Location 3 2
etc..
Is there a way to do that?
thanks for your help!
0 个评论
采纳的回答
KSSV
2021-5-3
REad about hist.
xbins = unique(Location);
[counts,centres] = hist(Location,xbins);
R = [centres counts]
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Histograms 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!