I am trying to plot bars of different widths using the BAR function in a loop, like this:
axeshold onfor n = 1:10 bar(n,sin(n),n/10)end
However, this ignores the specified barwidth and produces a plot where the bars all have the same width. I would like to be able to pass a vector of barwidths, like this:
bar(1:10,sin(1:10),[1:10]/10)
However, this currently results in an error:
??? Error using ==> xychk Too many input arguments. Error in ==> bar at 53 [msg,x,y] = xychk(args{1:nargs},'plot');
Best Answer