# MATLAB: How to generate clustered or linearly distriuted random points in a plane

random pointsstatisticsStatistics and Machine Learning Toolbox

Hi, I need to generate a set of random points (say 100 points) in the cartesian plane. The x and y values can range from 0 to 1, but there should be more points towards the bottom of the plane…. say maybe 40 or 45 of the points must have a y value less than 0.3… Is it possible?
Lekshmi
Edit : Is it possible to just distribute the points linearly along the y direction? That is, the points must be densely placed nearer zero, and get sparser as we move to 1. The whole thing must be more or less random with regard to placement of the points, but biased towards the bottom…. and the distribution must be linear. My knowledge of statistics is pretty bad.. so i dont know how exactly to put it.

 y = betarnd(2,4,100,1); x = rand(100,1); XY = [x y];
plot(XY(:,1),XY(:,2),'*')
x = 0:0.01:1;y = betapdf(x,2,4);plot(x,y)
y = betapdf(x,1,5);plot(x,y)