MATLAB Function Reference |
Syntax
ezplot(fun) ezplot(fun,[min,max]) ezplot(fun,[xmin,xmax,ymin,ymax]) ezplot(funx,funy) ezplot(funx,funy,[tmin,tmax]) ezplot(...,figure_handle) ezplot(axes_handle,...) h = ezplot(...)
Description
ezplot(fun)
plots the expression fun(x)
over the default domain -2 < x < 2.
fun
can be a function handle for an M-file function or an anonymous function (see Function Handles and Anonymous Functions) or a string (see the Remarks section).
ezplot(fun,[min,max])
plots fun(x)
over the domain: min
< x < max
.
For implicitly defined functions, fun2(x,y)
:
ezplot(fun2)
plots fun2(x,y) = 0
over the default domain -2 < x < 2, -2 < y < 2.
ezplot(fun2,[xmin,xmax,ymin,ymax])
plots fun2(x,y) = 0
over xmin
< x
< xmax
and ymin
< y
< ymax
.
ezplot(fun2,[min,max])
plots fun2(x,y) = 0
over min
< x
< max
and min
< y
< max
.
ezplot(funx,funy)
plots the parametrically defined planar curve funx(t)
and funy(t)
over the default domain 0 < t
< 2.
ezplot(funx,funy,[tmin,tmax])
plots funx(t)
and funy(t)
over tmin
< t
< tmax
.
ezplot(...,figure_handle)
plots the given function over the specified domain in the figure window identified by the handle figure
.
ezplot(axes_handle,...)
plots into the axes with handle axes_handle
instead of the current axes (gca
).
h = ezplot(...)
returns the handle to a line objects in h
.
Passing the Function as a String
Array multiplication, division, and exponentiation are always implied in the expression you pass to ezplot
. For example, the MATLAB syntax for a plot of the expression
which represents an implicitly defined function, is written as
That is, x^2
is interpreted as x.^2
in the string you pass to ezplot
.
Passing a Function Handle
Function handle arguments must point to functions that use MATLAB syntax. For example, the following statements define an anonymous function and pass the function handle fh
to ezplot
.
Note that when using function handles, you must use the array power, array multiplication, and array division operators (.^, .*, ./
) since ezplot
does not alter the syntax, as in the case with string inputs.
Passing Additional Arguments
If your function has additional parameters, for example k
in myfun
:
then you can use an anonymous function to specify that parameter:
Examples
This example plots the implicitly defined function
See Also
ezplot3
, ezpolar
, function_handle
, plot
Function Plots for related functions
ezmeshc | ezplot3 |
© 1994-2005 The MathWorks, Inc.