1. 程式人生 > >matlab統計一個數組中各元素出現的頻數、頻率

matlab統計一個數組中各元素出現的頻數、頻率

>> x =['If x is a numeric array, TABLE is a numeric matrix.']'; >> tabulate(x) Value Count Percent I 1 2.44% f 1 2.44% x 2 4.88% i 5 12.20% s 2 4.88% a 5 12.20% n 2 4.88%

u 2 4.88% m 3 7.32% e 2 4.88% r 5 12.20% c 2 4.88% y 1 2.44% , 1 2.44% T 1 2.44% A 1 2.44% B 1 2.44% L 1 2.44%
E 1 2.44% t 1 2.44% . 1 2.44%

例3】統計字元型陣列中各行元素出現的頻數、頻率