How to make a distribution from array
Show older comments
Hey everybody, I'm pretty new in Matlab and english is not my mother tongue, so please be very patience.
I really would like to plot and array vs his occurrences. For example, I've got this array:
T = [2,2,3,4,5,5,5,12,34,11,11]
I'd like to plot this points: A(2,2) B(3,1) C(4,1) D(5,3) E(12,1) F(34,1) G(11,2)
I don't want to make an histogram, I would like to plot points and then fit them with the best fit. How can I do?
Thank you very much.
2 Comments
Guillaume
on 1 Aug 2017
I'd like to plot these points ... I don't want to make an histogram
These points are the exact definition of an histogram.
Answers (1)
Akira Agata
on 1 Aug 2017
Plotting histogram and obtaining its bin counts are simply done by histogram and histcounts functions, respectively, like:
T = [2,2,3,4,5,5,5,12,34,11,11];
% Plot histogram
histogram(T);
% Obtain histogram bin counts
bins = histcounts(T);
Categories
Find more on Exploration and Visualization in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!