数据统计 tabul
Scilab Help >> Statistics > Summaries > tabul
tabul
frequency of values of a matrix or vector
[m]=tabul(X [,order])
order: ‘i’ 升序
‘d’ 降序,默认值
统计向量或矩阵中 数据元素出现的次数,对字符矩阵统计每个字符串的统计信息
X = [2 8 0 3 7 6 8 7 9 1 6 7 7 2 5 2 2 2 9 7]
m1 = tabul(X)
m2 = tabul(X, "i")
|
输出
-->m2 = tabul(X, "i")
m2 =
0. 1.
1. 1.
2. 5.
3. 1.
5. 1.
6. 2.
7. 5.
8. 2.
9. 2.
X = ["b" "bab" "a" "A" "A1" "a" "aa" "aa" "aa" "A" "b"]
m = tabul(X,"i")
|
输出
X =
!b bab a A A1 a aa aa aa A b !
m =
m(1)
!A !
! !
!A1 !
! !
!a !
! !
!aa !
! !
!b !
! !
!bab !
m(2)
2.
1.
2.
3.
2.
1.
运行结果: