What about color intensity
이전 댓글 표시
I want to display an image with red, green and blue intensity, between 1:5 lines and 2:8 columns, Thanks.
댓글 수: 1
Image Analyst
2012년 11월 25일
Do you want a red stripe, a green stripe, and a blue stripe in lines (rows) 1-5? If you had one color per row, then that's 3 rows, so what color do you want rows 4 and 5 to be? Same for the vertical stripes going down the image in the 7 columns 2 through 8? You have 3 colors and 7 columns. 7 is not a multiple of 3. So, what color goes into what column?
답변 (1개)
Walter Roberson
2012년 11월 25일
MyImage = zeros(3, 8, 3);
MyImage(1,:,1) = 1; %red
MyImage(1,:,2) = 0;
MyImage(1,:,3) = 0;
MyImage(2,:,1) = 0; %green
MyImage(2,:,2) = 1;
MyImage(2,:,3) = 0;
MyImage(3,:,1) = 0; %blue
MyImage(3,:,2) = 0;
MyImage(3,:,3) = 1;
image(MyImage)
카테고리
도움말 센터 및 File Exchange에서 Display 2-D Images에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!