- Get the array
- Read the first element
- Count the repetitions of the first element
- pdf_first=repetitions/length(array)
How can I find the probability of each term in the array?
12 次查看(过去 30 天)
显示 更早的评论
Let's say we have an arrary such [1,1,2,3,5,5], how can I find the probability of the terms? I am quite new in Matlab and I could not solve the problem.
Thanks!
2 个评论
KALYAN ACHARJYA
2020-5-5
编辑:KALYAN ACHARJYA
2020-5-5
One Way:
回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Multidimensional Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!