draw a histogram from an array

조회 수: 3 (최근 30일)
alpedhuez
alpedhuez 2022년 7월 16일
댓글: Image Analyst 2022년 7월 18일
I now have an array
date visitors
------ --------
1/1 5
1/2 10
1/3 12
What is the simplest way to draw a histogram of visitors?

채택된 답변

Image Analyst
Image Analyst 2022년 7월 16일
편집: Image Analyst 2022년 7월 16일
Did you try
bar(t.Data, t.Visitors);
grid on;
xlabel('Date');
ylabel('Number of Visitors');
This assumes that your histogram is in a table like you showed.
  댓글 수: 2
alpedhuez
alpedhuez 2022년 7월 16일
histogram(t.Visitors)
Image Analyst
Image Analyst 2022년 7월 18일
You'd need more than 3 samples. But if you have like hundreds of days, then that could get you a distribution of how many people visited during a certain interval of time (like one day or one week).

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Histograms에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by