12.07.2015 Views

MATLAB Function Reference (Volume 2: Graphics)

MATLAB Function Reference (Volume 2: Graphics)

MATLAB Function Reference (Volume 2: Graphics)

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.

contourRemarksExamplesIf you do not specify LineSpec, colormap and caxis control the color.If X or Y is irregularly spaced, contour calculates contours using a regularlyspaced contour grid, then transforms the data to X or Y.To view a contour plot of the functionz = xe( – x2 – y 2 )over the range –2 ≤ x ≤ 2, –2 ≤ y ≤ 3, create matrix Z using the statements[X,Y] = meshgrid(–2:.2:2,–2:.2:3);Z = X.∗exp(–X.^2–Y.^2);Then, generate a contour plot of Z.[C,h] = contour(X,Y,Z);clabel(C,h)colormap cool32.521.51−0.10.10.50−0.5−1−0.2−0.3−0.1−0.2−0.10 00.10.20.30.40.20.1−1.5−2−2 −1.5 −1 −0.5 0 0.5 1 1.5 22-101

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

Saved successfully!

Ooh no, something went wrong!