Colour matrix depending on the value

1 visualización (últimos 30 días)
Raúl
Raúl el 19 de Feb. de 2014
Hi all,
Thanks in advanced.
I have a matrix of 9x9 which those interesting values goes from a min to a max value. These values can vary depending on the input. There are useless data setup with value 0.
I want to colour each position depending on the value. My matrix is called 'subnetA'. I got these values min=1.2589e-08, max=1.0000e-07 and mean=5.6295e-08
I want:
- To setup my colormap range between 1.2589e-08 and 1.0000e-07)
- Colour in black those 0 values
- Colour in Red those values between 1.2589e-08 and 5.6295e-08
- Colour in Green those values between 5.6295e-08 and 1.0000e-07)
- Colour in Orange the mean value.
My script scans the matrix with the indexes i and j. 'i' are rows and 'j' columns. Then, subnet(i,j) will indicate a given position. I show the matrix with imagesc.
I hope it is clear.
Thanks again.
Raúl.

Respuestas (0)

Categorías

Más información sobre Colormaps en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by