[xb,yb] = bar(...)
bar(y)draws a bar graph of the elements of vector
bar(x,y) draws a bar graph of the elements in vector
y at the locations specified in vector
x. The values in
x must be evenly spaced and ascending.
y are matrices of the same size, one bar graph per column is drawn.
[xb,yb] = bar(y) and
[xb,yb] = bar(x,y) do not draw graphs, but return vectors
yb such that
plot(xb,yb) plots the bar chart. This is useful in situations where more control is needed over the appearance of a graph; for example, to incorporate a bar chart into a more elaborate
x = -2.9:0.2:2.9;
(c) Copyright 1994 by The MathWorks, Inc.