How to make a distribution from array

16 ビュー (過去 30 日間)
Stefano Righi
Stefano Righi 2017 年 7 月 31 日
編集済み: José-Luis 2017 年 8 月 1 日
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 件のコメント
Guillaume
Guillaume 2017 年 8 月 1 日
I'd like to plot these points ... I don't want to make an histogram
These points are the exact definition of an histogram.
José-Luis
José-Luis 2017 年 8 月 1 日
編集済み: José-Luis 2017 年 8 月 1 日
Do you mean you want to plot your histogram as a line and not as a bar plot? But as Guillaume has said, it would still be a histogram.

サインインしてコメントする。

回答 (1 件)

Akira Agata
Akira Agata 2017 年 8 月 1 日
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);

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by