partion of a rectangle into small rectangles with gaps
3 views (last 30 days)
Show older comments
Hello Everybody, I would like to wite a code that can divide a rectangle into a certain number of small rectangles( fixed number) together with gaps in between. The dimensions of the small rectangles should be between 0,6 and 9 and the same for the gaps.
2 Comments
Geoff Hayes
on 19 May 2020
Juan - do all of the "small" rectangles have the same dimension? How many rows and/or columns of the smaller rectangles would there be? Can you provide an illustration of what you are looking for?
Accepted Answer
darova
on 20 May 2020
Try imdilate and meshgrid
A = zeros(100);
[X,Y] = meshgrid(10:20:100);
A(X(:),Y(:)) = 1;
A1 = imdilate(A,ones(10));
imshow(A1)
More Answers (0)
See Also
Categories
Find more on Axis Labels 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!