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

Create successful ePaper yourself

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

ezcontourfPurpose2ezcontourfEasy to use filled contour plotterSyntaxDescriptionRemarksezcontourf(f)ezcontourf(f,domain)ezcontourf(...,n)ezcontourf(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.ezcontourf(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,ezcontourf('u^2 - v^3',[0,1],[3,6]) plots the contour lines for u 2 - v 3 over0 < u < 1, 3 < v < 6.ezcontourf(...,n) plots f over the default domain using an n-by-n grid. Thedefault value for n is 60.ezcontourf automatically adds a title and axis labels.Array multiplication, division, and exponentiation are always implied in theexpression you pass to ezcontourf. For example, the <strong>MATLAB</strong> syntax for afilled contour plot of the expression,sqrt(x.^2 + y.^2);is written as:ezcontourf('sqrt(x^2 + y^2)')That is, x^2 is interpreted as x.^2 in the string you pass to ezcontourf.ExamplesThe following mathematical expression defines a function of two variables, xand y.2-136

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

Saved successfully!

Ooh no, something went wrong!