Plot symbolic expression, equation, or function
ezplot(
plots a symbolic expression,
equation, or function f
)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(
plots f
,[min,max]
)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(
plots f
,[xmin,xmax,ymin,ymax]
)f
over the specified ranges along the abscissa and the
ordinate.
ezplot(
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.x,y
)
ezplot(
plots x = x(t) and y = y(t) over the specified range tmin <= t <= tmax.x,y
,[tmin,tmax]
)
ezplot(
plots f
,[min,max]
,fig
)f
over the specified range in the figure with the figure number
or figure handle fig
. The title of each plot window contains the word
Figure and the number, for example, Figure 1, Figure
2, and so on. If fig
is already open,
ezplot
overwrites the content of that figure with the new
plot.
ezplot(
plots f
,[xmin,xmax,ymin,ymax]
,fig
)f
over the specified ranges along the abscissa and the ordinate
in fig
.
ezplot(
plots x = x(t) and y = y(t) over the specified range in x,y
,[tmin,tmax]
,fig
)fig
.
returns the plot
handle as either a chart line or contour object.h
= ezplot(___)
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)
If you do not specify a plot range, ezplot
uses the interval [–2π 2π] as a starting point. Then it can choose to display a part of the plot
over a subinterval of [–2π 2π] where the plot has significant variation. Also, when selecting the
plotting range, ezplot
omits extreme values associated with
singularities.
ezplot
open a plot window and displays a plot there. If any plot
windows are already open, ezplot
does not create a new window. Instead,
it displays the new plot in the currently active window. (Typically, it is the window with
the highest number.) To display the new plot in a new plot window or in an existing window
other than that with highest number, use fig
.
If f
is an equation or function of two variables, then the
alphabetically first variable defines the abscissa (horizontal axis) and the other
variable defines the ordinate (vertical axis). Thus, ezplot(x^2 ==
a^2,[-3,3,-2,2])
creates the plot of the equation x2 = a2 with –3 <= a <= 3 along the horizontal axis, and –2 <= x <= 2 along the vertical axis.