error message from an example on histogram

1 回表示 (過去 30 日間)
cgo
cgo 2017 年 9 月 26 日
コメント済み: Steven Lord 2017 年 9 月 26 日
I am trying out an example in the MatLab documentations page:
https://www.mathworks.com/help/matlab/ref/histogram.html
The problem is simple: Make a histogram from the specified numbers. The example shows an output for
x = randn(10000,1);
h = histogram(x)
but doesn't show an output in my Matlab. There is an error message "Undefined function 'histogram' for input arguments of type 'double'."
What's wrong? And how to correct this?

回答 (1 件)

Steven Lord
Steven Lord 2017 年 9 月 26 日
The note at the end of that documentation page states "Introduced in R2014b". My guess is you are using an older release that predates the introduction of the histogram function.
  2 件のコメント
cgo
cgo 2017 年 9 月 26 日
So is there a way to use this without encountering the error?
Steven Lord
Steven Lord 2017 年 9 月 26 日
Use release R2014b or a later release.
If you must use a release prior to release R2014b, take a look at the hist function. It does not have the same functionality as histogram but it will show a plot of a histogram of your data.

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

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by