Matlab中unique函数和tabulate函数的区别


C = unique(A) returns the same data as in A, but with no repetitions. C is in sorted order.

>> unique([1 2 4 4 3 4])

ans =

1 2 3 4

tbl = tabulate(x) creates a frequency table of data in vector x. Information in tbl is arranged as follows:

  • 1st column — The unique values of x

  • 2nd column — The number of instances of each value

  • 3rd column — The percentage of each value

>> tabulate([1 2 4 4 3 4])
Value Count Percent
1 1 16.67%
2 1 16.67%
3 1 16.67%
4 3 50.00%


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM