I need to plot a probability density function of a uniformly distributed matrix from
U = rand (1,1000)
but I can't use the ksdensity function. I've tried this:
term = 1000;
U = rand (1,term);
x=0:0.001:1;
for j = 2:term;
u_height(j) = u_height(j-1)+((abs(x(j)-U(j))<0.01/2)/0.01)/term;
n_height(j) = n_height(j-1)+((abs(x(j)-N(j))<0.01/2)/0.01)/term;
end
but it's not plotting correctly