Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
Can someone help me? I am trying to print a 8-by-8 checkboard with red and black tiles
조회 수: 1 (최근 30일)
이전 댓글 표시
I know that am gonna use two nested for loops.
댓글 수: 0
답변 (2개)
Walter Roberson
2013년 9월 24일
No "for" loop is needed. You can index with an increment of 2.
Image Analyst
2013년 9월 24일
편집: Image Analyst
2013년 9월 24일
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)
![](https://www.mathworks.com/matlabcentral/images/broken_image.png)
댓글 수: 0
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!