Plotting histogram with user specified count

조회 수: 16 (최근 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 CenterFile Exchange에서 Histograms에 대해 자세히 알아보기

태그

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by