how to draw a checkerboard with 9 squares each with 0.5 dimension?
2 次查看(过去 30 天)
显示 更早的评论
I tried it by using the checkerboard command but it only gives us a even number of squares.
3 个评论
Geoff Hayes
2016-9-20
dinesh - please clarify 0.5 dimension means. I'm guessing it has something to do with the dimension of each square in the checkerboard but you will need to provide more information. Also, is this homework?
回答(2 个)
Thorsten
2016-9-20
You cannot create an image with pixels of dimension 0.5. The dimension of a pixel is always 1. Or what do you mean by 'with dimension 0.5'?
Image Analyst
2016-9-20
You can't have half a matrix element, but you can define the "width" of the element to be 0.5 or whatever you want. Then just use repmat(). First create one dark/light pair on one line. Then use repmat() to make a complete line. Then use repmat again to make a "band". Stitch together a band with a band of the opposite colors to get a band pair, like the top two rows of a chessboard. Then use repmat again to make as many vertical pairs as you want.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!