开发者

how to make a frequency function in matlab like the excel frequency function?

开发者 https://www.devze.com 2022-12-31 03:10 出处:网络
I have a list that is sorted and I want to know how many values are in each bin? I made bins using linsp开发者_JAVA百科ace(floor(fist_element_list), ceil(last_element_list), num_bins) Is there a built

I have a list that is sorted and I want to know how many values are in each bin? I made bins using linsp开发者_JAVA百科ace(floor(fist_element_list), ceil(last_element_list), num_bins) Is there a built in function or an easy way to do this in Matlab? All I can think of is doing it manually. I would like a frequency function like the one in excel.


hist is close. However, it's actually grouping items into bins, not counting values. Normally it plots, but you can get the data instead:

[freqs, vals] = hist(list, num_bins)

See also MATLAB : frequency distribution.

0

精彩评论

暂无评论...
验证码 换一张
取 消