Info
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
Can someone help me? I am trying to print a 8-by-8 checkboard with red and black tiles
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
I know that am gonna use two nested for loops.
0 comentarios
Respuestas (2)
Walter Roberson
el 24 de Sept. de 2013
No "for" loop is needed. You can index with an increment of 2.
2 comentarios
Walter Roberson
el 24 de Sept. de 2013
What do you get if you use
A = zeros(5,5);
A(1:2:end,:) = 1;
Image Analyst
el 24 de Sept. de 2013
Editada: Image Analyst
el 24 de Sept. de 2013
Use the checkerboard() function in the Image Processing Toolbox:
cb = 255 * (checkerboard(20) > 0); % checkerboard.
blank = zeros(size(cb), 'uint8'); % Totally black image.
% Put checkboard into only the red channel of an RGB image.
rgbImage = cat(3,cb,blank,blank);
imshow(rgbImage)
0 comentarios
La pregunta está cerrada.
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!