MATLAB: I need to distribute n number of samples randomly on a given grid surface by monte carlo would you help me please.

monte carlo sampling

i need to distribute n number of samples randomly on a given grid surface by monte carlo would you help me please.

Best Answer

Try this:
numPoints = 100; % Whatever you want
x = rand(1, numPoints);
y = rand(1, numPoints);
plot(x, y, 'b*');
grid on;