12.07.2015 Views

Basics of MATLAB and Beyond

Basics of MATLAB and Beyond

Basics of MATLAB and Beyond

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

m = gray(8);colormap(m)imagesc(1:1000)Most <strong>of</strong> matlab’s surface viewing functions use the colour map to applycolour to the surface depending on the z-value. The imagesc functionproduces a coloured image <strong>of</strong> the matrix argument, colouring each elementdepending on its value. The smallest element will take the colourspecified in the first row <strong>of</strong> the colour map, the largest element will takethe colour specified in the last row <strong>of</strong> the colour map, <strong>and</strong> all the elementsin between will take linearly interpolated colours.To get a plot <strong>of</strong> the levels <strong>of</strong> red, green, <strong>and</strong> blue in the current colourmap use rgbplot:colormap(summer)rgbplot(colormap)On the screen the lines corresponding to the red, green, <strong>and</strong> blue components<strong>of</strong> the colour map are coloured red, green, <strong>and</strong> blue, respectively.7.3 Colour BarTo display the current colour map use the colorbar function:z = peaks;colormap(gray(8))imagesc(z)colorbar7.4 Good <strong>and</strong> Bad Colour MapsMuch research has been done on human perception <strong>of</strong> colours <strong>and</strong>, in particular,how different viewers interpret coloured images as value-scales.c○ 2000 by CRC Press LLC

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!