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.

ezcontourPurpose2ezcontourEasy to use contour plotterSyntaxDescriptionRemarksezcontour(f)ezcontour(f,domain)ezcontour(...,n)ezcontour(f) plots the contour lines of f(x,y), where f is a string thatrepresents a mathematical function of two variables, such as x and y.The function f is plotted over the default domain: -2π < x < 2π, -2π < y < 2π.<strong>MATLAB</strong> chooses the computational grid according to the amount of variationthat occurs; if the function f is not defined (singular) for points on the grid, thenthese points are not plotted.ezcontour(f,domain) plots f(x,y) over the specified domain. domain can beeither a 4-by-1 vector [xmin, xmax, ymin, ymax] or a 2-by-1 vector [min, max](where min < x < max, min < y < max).If f is a function of the variables u and v (rather than x and y), then the domainendpoints umin, umax, vmin, and vmax are sorted alphabetically. Thus,ezcontour('u^2 - v^3',[0,1],[3,6]) plots the contour lines for u 2 - v 3 over0 < u < 1, 3 < v < 6.ezcontour(...,n) plots f over the default domain using an n-by-n grid. Thedefault value for n is 60.ezcontour automatically adds a title and axis labels.Array multiplication, division, and exponentiation are always implied in theexpression you pass to ezcontour. For example, the <strong>MATLAB</strong> syntax for acontour plot of the expression,sqrt(x.^2 + y.^2)is written as:ezcontour('sqrt(x^2 + y^2)')That is, x^2 is interpreted as x.^2 in the string you pass to ezcontour.ExamplesThe following mathematical expression defines a function of two variables, xand y.2-133

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

Saved successfully!

Ooh no, something went wrong!