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.

Red Green Blue Colour0 0 0 Black1 1 1 White1 0 0 Red0 1 0 Green0 0 1 Blue1 1 0 Yellow1 0 1 Magenta0 1 1 Cyan.5 .5 .5 Gray.5 0 0 Dark red1 .62 .4 Dark orange.49 1 .83 Aquamarine.95 .9 .8 ParchmentYellow, for example, consists <strong>of</strong> the combination <strong>of</strong> the full intensities<strong>of</strong> red <strong>and</strong> green, with no blue, while gray is the combination <strong>of</strong> 50%intensities <strong>of</strong> red, green, <strong>and</strong> blue.You can create your own colour maps or use any <strong>of</strong> matlab’s manypredefined colour maps:hsv hot gray bone copper pinkwhite flag lines colorcube jet prismcool autumn spring winter summerTwo nonst<strong>and</strong>ard colour maps that are supplied in the companion s<strong>of</strong>twareinclude redblue <strong>and</strong> myjet. The first consists <strong>of</strong> red blending toblue through shades <strong>of</strong> gray. The second consists <strong>of</strong> a modification <strong>of</strong>the jet colour map that has white at the top instead <strong>of</strong> dark red.These functions all take an optional parameter that specifies the number<strong>of</strong> rows (colours) in the colour map matrix. For example, typinggray(8) creates an 8 × 3 matrix <strong>of</strong> various levels <strong>of</strong> gray:>> gray(8)ans =0 0 00.1429 0.1429 0.14290.2857 0.2857 0.28570.4286 0.4286 0.42860.5714 0.5714 0.57140.7143 0.7143 0.71430.8571 0.8571 0.85711.0000 1.0000 1.0000To tell matlab to use a colour map, type it as an input to the colormapfunction:c○ 2000 by CRC Press LLC

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

Saved successfully!

Ooh no, something went wrong!