I want to generate n random number in a For loop from 1:n. But, every time as the loop iteration increase the number of generated points would increase as well. I need to generate just one pair(x,y) random number in every iterations.
For i=1:10;%generate a random x,y
x(i)=rand(1)y(i)=rand(1)if x(i)<0.01 && y(i)<0.5%generate another random x,y and make comparison again
x(i)=rand(1)y(i)=rand(1)returnendend%For example when i=4 this code generate 4 random x,y which is not my favorite i want just another single x,y
Best Answer