I'm a little bit stuck on how to plot a histogram in MatLab without using hist function
the question is that
Generate a random number between (0 ,100) and plot 1000 of those random digits on xy,plan as histogram
example let interval is 10
x | y
0 -10 | 5
10-20 | 9
20-30 | 15
etc ...
where x is interval and y represent the repeated random number in that interval
I try to write this code
function []=drawhist(a,b)
x=a+(b-a)*rand(1,1000);
bar(x)
end
but not give me the output desired , please help me with any idea to understand how to write this function