How can I plot a matrix as a colored grid?
조회 수: 19 (최근 30일)
이전 댓글 표시
Hello,
I've been hitting hard at this for a while, but haven't been able to achieve it. I have a matrix whose values range from 0 to 300. I'd like to plot this matrix as a colored grid, where the Hue angle is given by the element of the matrix at that point, while keeping luminosity and saturation constant. How can I do this in MATLAB?
댓글 수: 0
답변 (2개)
Walter Roberson
2017년 3월 19일
H = double(YourMatrix)/360;
hsv = H;
hsv(:,:,2) = TheConstantStaturation;
hsv(:,:,3) = TheConstantValue;
rgb = hsv2rgb(hsv);
image(rgb); %or imshow(rgb)
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Discrete Data Plots에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!