MATLAB: Is histogram(​’BinEdges’​,edges,’Bi​nCounts’,c​ounts) broken or deprecated

barhistogramMATLAB

According to the current docs for histogram() , the following is valid usage:
histogram('BinEdges',-2:2,'BinCounts',[5 8 15 9])
and yet when executed, it refuses to take 'BinEdges' as its first argument (and in separate arrangements, it doesn't seem recognize 'BinCounts' as a valid name):
Error using histogram
Expected input number 1, x, to be one of these types:
double, single, uint8, uint16, uint32, uint64, int8, int16, int32, int64, logical
Instead its type was char.
Error in histogram (line 116)
validateattributes(x,{'numeric','logical'},{'real'}, mfilename, 'x', 1)
Does histogram() no longer have this functionality? It matters, to me, since it seems to be the only usage that allows you to specify counts for each bin. Failing that I suppose I can just use bar().

Best Answer

It's not deprecated, it's brand new in R2016b.
I suspect you're on an older version.