how can I draw histogram of a sine wave without "hist" command and with "plot" command?
조회 수: 3 (최근 30일)
이전 댓글 표시
I want to write a program to draw a histogram for sine wave without the "hist" command and draw its histogram with "plot" command. the number of Bins can be a constant number. or evenif I can define a function that its input are : the number of Bins and the signal varible. I don't know how , can any body help me?
댓글 수: 0
답변 (1개)
Walter Roberson
2013년 3월 9일
It can be done. You would need to use something like
plot( [1 1 2 2 3 3 4 4 5 5], [0 v1 v1 0 0 v2 v2 0 0 v3])
where v1, v2, v3 are the height values.
Have you considered using bar() instead of plot()
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Histograms에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!