Reputation: 2564
I am working in Matlab 2009. I have a array (say test) like:
0 0 0 0
1.2 1.2 1.4 1.6
1.2 1.3 1.3 1.7
This array actually represents a Image after performing few operations.
I want the same values to be represented in one color. Say all pixels corresponding to value 1.2 should be represented in red color (while using imshow
function).
How can this be done? Please help
Upvotes: 1
Views: 279
Reputation: 7751
The function imagesc
will assign one color per value.
The code
a=[ 0 0 0 0
1.2 1.2 1.4 1.6
1.2 1.3 1.3 1.7];
imagesc(a);
will produce
Upvotes: 3