How do I tune a color scale to a matrix image?
조회 수: 1(최근 30일)
표시 이전 댓글
Hi, I have a problem with my other programming tool and have to use MatLab to draw a 2D map with the specific color scale. The function is basically like mat2gray(), only difference is that instead of the gray color scale, I need it to be like the color scale in the image attached.
댓글 수: 0
jonas 2018년 9월 18일
편집: jonas 2018년 9월 18일
You can easily draw your matrix with a specific colormap. You don't need to convert it to an image beforehand.
If you then want the image data, you can just type
I = getframe;
and then you can treat is as an image
댓글 수: 3
jonas 2018년 9월 23일
Here you go
cmap=im2double([I(:,1,1) I(:,1,2) I(:,1,3)])
Find more on Image Arithmetic in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!