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.

fac2 = [1 2 61 6 31 4 61 6 5];The resulting display is now rendered correctly no matter what the viewingangle:clfpatch(’vertices’,vert2,...’faces’,fac2,’facecolor’,’y’)view(3),grid,xyzPatch ColouringSimple solid colouring <strong>of</strong> patches can be specified using the namedcolours, as we did for the yellow (’y’) patches <strong>of</strong> the previous section.You can also use arbitrary RGB colours. Here is a patch that should beorange on your display:xt = [0 1 .5];yt = [0 0 1];clfh = patch(xt,yt,[1 .4 0])Patches have a number <strong>of</strong> properties that control how they are coloured.By using coloured patches, you can make pictures <strong>of</strong> objects that arecolour-coded to some quantity you want to display. For example, thestress <strong>of</strong> a bent bar could be presented as the colour <strong>of</strong> the bar. Here is alist <strong>of</strong> patch colour properties <strong>and</strong> a description <strong>of</strong> what they do (takenfrom the Using <strong>MATLAB</strong> Graphics manual).CData Specify single, per face, or per vertex colours in conjunction withx, y, <strong>and</strong> z data.CDataMapping Specifies whether colour data is scaled or used directlyas indices into the Figure colormap.FaceVertexCData Specify single, per face, or per vertex colours in conjunctionwith faces <strong>and</strong> vertices data.EdgeColor Edges can be invisible, a single colour, a flat colour determinedby vertex colours, or interpolated colours determined byvertex colours.FaceColor Faces can be invisible, a single colour, a flat colour determinedby vertex colours, or interpolated colours determined byvertex colours.z−1110.5100y−1 000 0.5 10.5x1c○ 2000 by CRC Press LLC

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

Saved successfully!

Ooh no, something went wrong!