showing a colored matrix with colormap

4 visualizaciones (últimos 30 días)
abdulkawi alareefi
abdulkawi alareefi el 7 de Jun. de 2019
Comentada: abdulkawi alareefi el 9 de Jun. de 2019
Sorry for this simple question.
I have a 2D matrix , and I was trying to display it as a colored image uisng "colormap", but I just get black and white image.
figure('Name','network matrix');
imsh=imshow(nwmat, 'InitialMagnification','fit');
colormap ('jet');
The figure' colors supposed to be similar to this one
but i get a figure with colors like this
  2 comentarios
Stephen23
Stephen23 el 7 de Jun. de 2019
Editada: Stephen23 el 7 de Jun. de 2019
Your array only consists of two values:
>> unique(nwmat(:))
ans =
0
1
Would you expect two values to be displayed with more than two colors?
Or do you want two other colors to be used to represent the two values in your array?
abdulkawi alareefi
abdulkawi alareefi el 8 de Jun. de 2019
I am sorry. It's my mistake . I attached the wrong matrix. I have attached the original one named "nwmat". Thanks for your concern.

Iniciar sesión para comentar.

Respuesta aceptada

Stephen23
Stephen23 el 8 de Jun. de 2019
imshow(nwmat,'DisplayRange',[],'Colormap',jet(64))

Más respuestas (0)

Categorías

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

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by