histogram function not working

5 次查看(过去 30 天)
I am trying to use the histogram function, and even the basic MathWorks demonstration does not work in my Matlab
x = 2*randn(5000,1) + 5;
histogram(x,'Normalization','pdf')
I get the following mistake: Undefined function 'histogram' for input arguments of type 'double'.
Error in TEST2 (line 2) histogram(x,'Normalization','pdf') >>

采纳的回答

the cyclist
the cyclist 2015-10-6
Those commands produce a histogram for me (R2015b). The histogram command is relatively new, introduced a couple versions ago. Do you have an older version? What do the commands
which histogram
and
doc histogram
do for you?
  3 个评论
Gabs
Gabs 2015-10-6
I got this to work
data = 2*randn(5000,1) + 5
hist(data)
Thank you
Steven Lord
Steven Lord 2015-10-6
At the bottom of the online documentation page for HISTOGRAM it says "Introduced in R2014b".

请先登录,再进行评论。

更多回答(0 个)

类别

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