Why is it not possible to use HIST and HISTC with the Parameter/Value Syntax in MATLAB 7.9 (R2009b)?

1 view (last 30 days)
I want to use the HIST and HISTC function in MATLAB 7.9 (R2009b). Unfortunately it is not possible to use the Parameter/Value syntax with these two functions:
The doc lists ‘style’ options. In the first it is only mention grouped or stacked but the points below mentions histc and hist as well.
web([docroot '/techdoc/ref/barh.html'])
Aswell there is this information:
Note When you use either the hist or histc option, you cannot also use parameter/value syntax. These two options create graphic objects that are patches rather than barseries. See Backward-Compatible Versions for details.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 28 Jan 2010
HIST and HISTC cannot be used with the Parameter/Value Syntax in MATLAB.
As a workaround you can adapt the following example to set these properties using the SET and GET accessor methods associated with each Handle Graphics object created:
x = -2.9:0.1:2.9;
y = randn(10000,1);
data = histc(y,x);
h = bar(x,data)
set(h,'FaceColor','red')

More Answers (0)

Products


Release

R2009b

Community Treasure Hunt

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

Start Hunting!