02.03.2016 Views

MATLAB by rudra pratap

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

96 Interactive Computation<br />

. u<br />

0 @ 0<br />

·P<br />

c<br />

@) ©<br />

'<br />

0 @ 0<br />

. n<br />

. ·• ' .<br />

Figure 3.14: Contour plots of Z<br />

ezcontour and (b) ezcontourf.<br />

(a)<br />

(b)<br />

cos xcos y exp(- J(x2 + y2)/4) with (a)<br />

Example: Here is an example of the surface plot for Z = -5/(1 + x 2 + y 2 )<br />

over the domain lxl < 3 and IYI < 3.<br />

Z = inline ('-5 ./(1+x . -2+y. - 2) ');<br />

ezsurf(Z, [-3,3,-3,3])<br />

The plot produced is similar to the one shown in Fig. 3.15 with no contours.<br />

GYJILIII4 An even prettier looking variant of ezsurf is ezsurfc, which combines<br />

the surface plot with its contour plot. See Fig. 3.15, which is produced with<br />

the command ezsurf c (Z, [ -3, 3] ) for the same function Z, as specified in<br />

the preceding ezsurf example.<br />

·2<br />

·3<br />

Figure 3.15: 3-D surface plot of Z = -5/(1 + x2 + y2) with ezsurfc.<br />

There are two more functions in the ez stable, ezmesh and ezmeshc, that are<br />

used for 3-D plotting. These functions work exactly like the surface plotting<br />

functions except that they create the 3-D graphs with wireframe meshes rather<br />

than surface pat.ches.

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

Saved successfully!

Ooh no, something went wrong!