how to draw a checkerboard with 9 squares each with 0.5 dimension?
Mostra commenti meno recenti
I tried it by using the checkerboard command but it only gives us a even number of squares.
3 Commenti
mbonus
il 20 Set 2016
I would assume that MATLAB won't allow you to create a checkerboard with an odd number of squares due to the fact that by definition checkerboards have an even amount of squares on a side. The easiest way would most likely by to create a logical matrix representing the squares and calling image().
Geoff Hayes
il 20 Set 2016
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?
dinesh varma penmetsa
il 20 Set 2016
Risposte (2)
Thorsten
il 20 Set 2016
0 voti
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'?
1 Commento
dinesh varma penmetsa
il 20 Set 2016
Modificato: dinesh varma penmetsa
il 20 Set 2016
Image Analyst
il 20 Set 2016
0 voti
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.
Categorie
Scopri di più su Image Arithmetic in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!