フィルターのクリア

Plotting histogram with user specified count

10 ビュー (過去 30 日間)
Ayan Sharma
Ayan Sharma 2023 年 6 月 12 日
コメント済み: Ayan Sharma 2023 年 6 月 14 日
I have a csv file that contains the values to be plotted with their respective counts. Unfortunately, Matlab's histogram function does not seem to have such input. Please specify any method

採用された回答

Image Analyst
Image Analyst 2023 年 6 月 12 日
If the data file is the histogram itself, you can use bar to plot it.
xy = readmatrix(fileName);
x = xy(:, 1); % Bin values;
y = xy(:, 2); % Histogram count values.
% Plot
bar(x, y);
grid on;
xlabel('Bin Value');
ylabel('Count');
  1 件のコメント
Ayan Sharma
Ayan Sharma 2023 年 6 月 14 日
Thank you. Btw, do you have any idea about binning?

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

その他の回答 (1 件)

Samay Sagar
Samay Sagar 2023 年 6 月 12 日
You can use the readmatrix function to read csv files. You can plot histogram using the array returned by the readmatrix function.
  2 件のコメント
Ayan Sharma
Ayan Sharma 2023 年 6 月 12 日
I am already using it. But how do I plot it
Ayan Sharma
Ayan Sharma 2023 年 6 月 12 日
It should look like this, and I have the Values and No. of samples in the csv file in 2 columns

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

カテゴリ

Help Center および File ExchangeHistograms についてさらに検索

タグ

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by