I am preparing a Beamer presentation, and would like to have kind of a function (I will do this several times with different inputs) that given a matrix with elements between 0 and 1 (like an output from matlab: X = rand(10,20), shows a color image (like the output of imagesc(X)) with frames around the cells. So, for example if the input is X =[0.72, 0.70, 0.45, 0.58, 0.34, 0.17, 0.39] the output looks like this image

and if it is a matrix, the following image:

What MATLBA does for imagesc(X) is first making a colormap with RGB values, something like
colormap
ans =
0 0 0
0 0 0.6250
0 0 0.6875
0 0 0.7500
0 0 0.8125
0 0 0.8750
0 0 0.9375
0 0 1.0000
0 0.0625 1.0000
0 0.1250 1.0000
0 0.1875 1.0000
0 0.2500 1.0000
0 0.3125 1.0000
0 0.3750 1.0000
0 0.4375 1.0000
0 0.5000 1.0000
0 0.5625 1.0000
0 0.6250 1.0000
0 0.6875 1.0000
0 0.7500 1.0000
0 0.8125 1.0000
0 0.8750 1.0000
0 0.9375 1.0000
0 1.0000 1.0000
0.0625 1.0000 0.9375
0.1250 1.0000 0.8750
0.1875 1.0000 0.8125
0.2500 1.0000 0.7500
0.3125 1.0000 0.6875
0.3750 1.0000 0.6250
0.4375 1.0000 0.5625
0.5000 1.0000 0.5000
0.5625 1.0000 0.4375
0.6250 1.0000 0.3750
0.6875 1.0000 0.3125
0.7500 1.0000 0.2500
0.8125 1.0000 0.1875
0.8750 1.0000 0.1250
0.9375 1.0000 0.0625
1.0000 1.0000 0
1.0000 0.9375 0
1.0000 0.8750 0
1.0000 0.8125 0
1.0000 0.7500 0
1.0000 0.6875 0
1.0000 0.6250 0
1.0000 0.5625 0
1.0000 0.5000 0
1.0000 0.4375 0
1.0000 0.3750 0
1.0000 0.3125 0
1.0000 0.2500 0
1.0000 0.1875 0
1.0000 0.1250 0
1.0000 0.0625 0
1.0000 0 0
0.9375 0 0
0.8750 0 0
0.8125 0 0
0.7500 0 0
0.6875 0 0
0.6250 0 0
0.5625 0 0
0.5000 0 0
Then, based on this map, assign colors to the elements.
I was wondering if this is possible in tikz?

