generate twenty points within the rectangle defined by (0,0) left boom coner and (8,6) right top corner

1 view (last 30 days)
generate twenty points within the rectangle defined by (0,0) left boom coner and (8,6) right top corner in a matrix form(20*2)

Answers (1)

Walter Roberson
Walter Roberson on 25 Jan 2016
For continuous values in a uniform distribution, use
rand(SIZE_OF_ARRAY) * (MaximumValue - MinimumValue) + MinimumValue
You would do that independently for the two coordinates.

Categories

Find more on Random Number Generation in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!