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

10 Ansichten (letzte 30 Tage)
img = 256

Antworten (2)

David Hill
David Hill am 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 am 7 Sep. 2022
ch = checkerboard(16, 8, 8)>0.5;
image(ch); colormap(gray(2)); axis off

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by