I am creating an image of size 256×256 with a black and white checkerboard pattern. Size of each block should be 16×16 but I am stuck how to get started

1 view (last 30 days)
img = 256

Answers (2)

David Hill
David Hill on 7 Sep 2022
a=ones(16,16,3)*.01;
b=ones(16,16,3);
m=repmat([a,b;b,a],8,8);
imshow(m)

Walter Roberson
Walter Roberson on 7 Sep 2022
ch = checkerboard(16, 8, 8)>0.5;
image(ch); colormap(gray(2)); axis off

Categories

Find more on Simulink in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!