hist & histogram which toolbox

조회 수: 6 (최근 30일)
SteveH
SteveH 2016년 3월 18일
댓글: Star Strider 2016년 3월 18일
Mathworks.com states 'hist is not recommended. Use histogram instead.' However when I use example given I get the error below. I suspect I don't have the right toolbox, but strangely Google searches don't answer 'which toolbox has histogram' DO I need another toolbox?
X = randn(1000,1); h = histogram(X) Undefined function 'histogram' for input arguments of type 'double'.
  댓글 수: 1
Adam
Adam 2016년 3월 18일
It should be in the main toolbox if you are using > R2014b. If you are using an earlier version then it hadn't been introduced in the main toolbox. I don't know if it existed in some other toolbox before then though.

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

답변 (1개)

Star Strider
Star Strider 2016년 3월 18일
Be careful of the documentation you’re reading! The current online documentation is for R2016a. If you have R2016a, you should have histogram. If you have R2013b or earlier, you won’t.
In your Command Window, type:
doc hist
doc histogram
and see what the Help Browser does.
  댓글 수: 2
SteveH
SteveH 2016년 3월 18일
using R2014a so that explains why histogram doesn't work. Thanks
Star Strider
Star Strider 2016년 3월 18일
My pleasure.
The hist function should work well enough for you. There isn’t a lot of difference between them.

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by