I am having a big problem in Matlab, because it seems that I want to do something that is not so usual.
Basically I am trying to implement a way of group distributio
The simplest solution is to use rectangle
:
% sample data: set the start of each bar, the bottom (here 0), the width and the height
x = [0.5 0.6 0.9 1 1.2]; % start of bar
y = zeros(length(x),1);
dx = diff([x 1.8]); % width of bar
dy = [1 3 2 .5 .1];
figure, hold on
for ii=1:length(x)
rectangle('position',[x(ii) y(ii) dx(ii) dy(ii)])
end
axis([0.5 2 0 4.1])
ylabel('Prob density')
xlabel('Time')