How to draw histogram with known values and their ratio?
1 回表示 (過去 30 日間)
古いコメントを表示

Row 2 is the ratio and Row 3 are X values.
My question is how to draw a distribution plot with known X values and their specific values of ratio.
0 件のコメント
回答 (1 件)
Image Analyst
2019 年 7 月 7 日
Do you mean row? Or column?
Have you tried
histogram(data(:, 2));
And I really have no idea what "a distribution plot with known X values and their specific values of ratio." is. Maybe you can re-word that to explain it better.
But in general histogram() creates and plots distributions as bar charts. Or you can use histcounts() followed by bar().
3 件のコメント
Image Analyst
2019 年 7 月 7 日
Still not clear, but this seems to be what you said:
edges = [-inf, 10, 20, 30, inf];
histogram(X(:, 3), edges); % Histogram of col3 with specified bin edges.
column2Sum = sum(X(:, 2)) % Sum up column 2.
参考
カテゴリ
Help Center および File Exchange で Data Distribution Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!