ezplot
is a function in MATLAB that plots a symbolic expression, equation or a function handle in the current axes of the current figure. It is useful for creating quick plots of mathematical functions without explicitly defining them.
Syntax:
main.m20 chars2 lines
Here, fun
represents a symbolic expression or a function handle, and [a, b]
is the range over which to plot the function.
Example:
main.m101 chars7 lines
This code will plot the function f = x^2 + 2*x + 1
over the range [-5, 5]
and adds labels to the x and y axis.
Note that ezplot
is now replaced with fplot
and implicitplot
in newer versions of MATLAB. fplot
is used to plot explicit functions whereas implicitplot
is used to plot implicit functions.
gistlibby LogSnag