How can I create an image in MATLAB by creating a 3D RGB matrix and display it in a MATLAB window?
조회 수: 7 (최근 30일)
이전 댓글 표시
The image should look like a red square above a blue square.
댓글 수: 0
답변 (1개)
Bshara Murr
2017년 11월 27일
new = 255 * ones(dimensions, dimensions, 3, 'uint8');
new(:,:,2) = 0;
imshow(new);
The second line sets the green channel to zero
댓글 수: 5
Bshara Murr
2017년 11월 27일
편집: Bshara Murr
2017년 11월 27일
new = 255 * ones(100, 50, 3, 'uint8');
new(1:50,:,2) = 0;
new(1:50,:,3) = 0;
new(51:100,:,2) = 0;
new(51:100,:,1) = 0;
imshow(new);
Is this what you are looking for?
참고 항목
카테고리
Help Center 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!