How to customize "colormap" in matlab?

in an image i have to set colormap as gray, and i need the min color to be white and max color to be gray. by default min color is black and max color is white.how can i customize this using a command?
and how the image due to imagesc command can be adjusted in figure at desired position( in the middle of figure)?

Categorie

Richiesto:

il 16 Mar 2015

Modificato:

il 11 Ott 2018

Community Treasure Hunt

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

Start Hunting!

Translated by