Random squares/rectangles in a square
I have a square of size 1, that is (0,1)x(0,1). In this square, I would like to create random squares or rectangles of various sizes where none of them share an edge with each other. Meaning, I want them randomly spaced out. Then, i would like to save the values or coordinates within each squares to compare them with an input (x,y) such that (x,y) has value 1 if it’s in the square, and zero if it’s not.
I want to repeat this(random sampling of squares) for 5 different samples.
Thanks!I have a square of size 1, that is (0,1)x(0,1). In this square, I would like to create random squares or rectangles of various sizes where none of them share an edge with each other. Meaning, I want them randomly spaced out. Then, i would like to save the values or coordinates within each squares to compare them with an input (x,y) such that (x,y) has value 1 if it’s in the square, and zero if it’s not.
I want to repeat this(random sampling of squares) for 5 different samples.
Thanks! I have a square of size 1, that is (0,1)x(0,1). In this square, I would like to create random squares or rectangles of various sizes where none of them share an edge with each other. Meaning, I want them randomly spaced out. Then, i would like to save the values or coordinates within each squares to compare them with an input (x,y) such that (x,y) has value 1 if it’s in the square, and zero if it’s not.
I want to repeat this(random sampling of squares) for 5 different samples.
Thanks! inpolygon, generating random squares MATLAB Answers — New Questions