Skip to Main Content Skip to Search
Product Documentation

ezplot - Plot symbolic expression, equation, or function

Syntax


ezplot(f)
ezplot(f,[min,max])
ezplot(f,[xmin,xmax,ymin,ymax])
ezplot(f,fign)
ezplot(x,y)
ezplot(x,y,[tmin,tmax])
ezplot(f,figure_handle)

Description

ezplot(f) plots a symbolic expression, equation, or function f. By default, ezplot plots a univariate expression or function over the range [–2π 2π] or over a subinterval of this range. If f is an equation or function of two variables, the default range for both variables is [–2π 2π] or over a subinterval of this range.

ezplot(f,[min,max]) plots f over the specified range. If f is a univariate expression or function, then [min,max] specifies the range for that variable. This is the range along the abscissa (horizontal axis). If f is an equation or function of two variables, then [min,max] specifies the range for both variables, that is the ranges along both the abscissa and the ordinate.

ezplot(f,[xmin,xmax,ymin,ymax]) plots f over the specified ranges along the abscissa and the ordinate. For this syntax, f needs two variables. If f is univariate, this syntax throws an error.

ezplot(f,fign) displays the plot in the plot window with the number fign. The title of each plot window contains the word Figure and the number, for example, Figure 1, Figure 2, and so on. If the plot window with the number fign is already opened, ezplot overwrites the content of that window with the new plot.

ezplot(x,y) plots the parametrically defined planar curve x = x(t) and y = y(t) over the default range 0 <= t <= 2π or over a subinterval of this range.

ezplot(x,y,[tmin,tmax]) plots x = x(t) and y = y(t) over the specified range tmin <= t <= tmax.

ezplot(f,figure_handle) plots f in the plot window identified by the handle figure_handle.

Tips

Input Arguments

f

Symbolic expression, equation, or function.

[min,max]

Numbers specifying the plotting range. For a univariate expression or function, the plotting range applies to that variable. For an equation or function of two variables, the plotting range applies to both variables. In this case, the range is the same for the abscissa and the ordinate.

Default: [-2*pi,2*pi] or its subinterval.

[xmin,xmax,ymin,ymax]

Numbers specifying the plotting range along the abscissa (first two numbers) and the ordinate (last two numbers).

Default: [-2*pi,2*pi,-2*pi,2*pi] or its subinterval.

fign

Number of the figure window where you want to display a plot.

Default: If no plot windows are open, then 1. If one plot window is open, then the number in the title of that window. If more than one plot window is open, then the highest number in the titles of open windows.

x,y

Symbolic expressions or functions defining a parametric curve x = x(t) and y = y(t).

[tmin,tmax]

Numbers specifying the plotting range for a parametric curve.

Default: [0,2*pi] or its subinterval.

figure_handle

Figure handle specifying the plot window in which you create or modify a plot.

Default: Current figure handle returned by gcf.

Examples

Plot the expression erf(x)*sin(x) over the range [–ππ]:

syms x
ezplot(erf(x), [-pi, pi])

 

Plot this equation over the default range:

syms x y
ezplot(x^2 == y^4)

 

Create this symbolic function f(x, y):

syms x y
f(x, y) = sin(x + y)*sin(x*y);

Plot this function over the default range:

ezplot(f)

 

Plot this parametric curve:

syms t
x = t*sin(5*t);
y = t*cos(5*t);
ezplot(x, y)

See Also

ezcontour | ezcontourf | ezmesh | ezmeshc | ezplot3 | ezpolar | ezsurf | ezsurfc | plot

More About

  


Free Symbolic Math Interactive Kit

See how symbolic computations can help you find analytical solutions to math and engineering problems.

Get free kit

Trials Available

Try the latest version of symbolic math products.

Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS