how to create black and white checkerboards with different number of squares
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Jimmy Liang
am 18 Apr. 2019
Kommentiert: Walter Roberson
am 25 Apr. 2019
How can I create black and white checkerboard with different number of squares, for example, 2 squares, 4, 8, 16,32....
with the inbuilt checkerboard function, there is grey squares, which is undesirable
0 Kommentare
Akzeptierte Antwort
Adam Danz
am 18 Apr. 2019
Bearbeitet: Adam Danz
am 23 Apr. 2019
The output of checkerboard() contains normalized values where 0 represents black, 1 represents white, and values between represent shades of gray. Just replace the values greater than 0 with 1.
I = checkerboard(20);
I(I>0) = 1;
imshow(I)
3 Kommentare
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!