matlab怎么编程统计数据出现的频率?

2024-12-31 05:23:15
推荐回答(2个)
回答1:

>> x=[1,1,2,3,3,3,4]

x =

1 1 2 3 3 3 4

>> tabulate(x)
Value Count Percent
1 2 28.57%
2 1 14.29%
3 3 42.86%
4 1 14.29%

回答2:

x=[1,1,2,3,3,3,4]
y = hist(x,4)