How to generate random parking lot size?
2 views (last 30 days)
Show older comments
Hi,
I want to create a parking lot by plotting with random number of lots depending on its dimensions (each lot is 6m x 3m) and the min value is 4 rows x 6 columns to 8 rows and 8 columns. Can anyone help me?
0 Comments
Answers (1)
Walter Roberson
on 7 Apr 2021
[randi([4 8]), randi([6 8])]
2 Comments
Walter Roberson
on 7 Apr 2021
format long g
r = randi([4 8])
c = randi([6 8])
d = char(logical(repelem(checkerboard(3, r, c),2,1)) + ' ');
e = d(1:end/2, 1:end/2)
See Also
Categories
Find more on Creating and Concatenating Matrices 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!