Fplot Ezplot
Fplot is almost an alias for ezplot as all ez. Will be replaced by MATLAB with function names f. Ezplot should mimick the Matlab function of the same name, has more functionality, misses the possibility to plot several functions.
Ezplot (f) plots the expression f (x) over the default domain -2π f (x) is an explicit function of only x. Where as, fplot (f) plots the curve defined by the function y = f (x) over the default interval -5 5 for x. We can plot the curve over some specified interval as well. The function fplot also generates two-dimensional plots with linear axes using a function name and limits for the range of the x-coordinate instead of the x and y data. For example, fplot (@sin, -10, 10, 201). H = ezplot Plot the 2-D curve defined by the function f. With plot you have to manually define the x values and compute the corresponding y given by the function. x = 0.01:1; y = sin(10.x); plot(x,y,'.-') With fplot you define the function generically, for example as an anonymous function; pass a handle to that function; and let Matlab choose the x values and compute the y values. Fplot (f,xinterval) traza sobre el intervalo especificado. Especifique el intervalo como un vector de dos elementos con la forma xmin xmax.
Description
Easy function plot w/o the need to define x, y
coordinates.
Usage
Arguments
f | Function to be plotted. |
interval | interval [a, b] to plot the function in |
a, b | Left and right endpoint for the plot. |
n | Number of points to plot. |
col | Color of the function graph. |
add | logical; shall the polt be added to an existing plot. |
lty | line type; default 1. |
lwd | line width; default 1. |
marker | no. of markers to be added to the curve; defailt: none. |
pch | poimt character; default circle. |
grid | Logical; shall a grid be plotted?; default |
gridcol | Color of grid points. |
fill | Logical; shall the area between function and axis be filled?;default: |
fillcol | Color of fill area. |
xlab | Label on the |
ylab | Label on the |
main | Title of the plot |
... | More parameters to be passed to |
Details
Calculates the x, y
coordinates of points to be plotted andcalls the plot
function.
If fill
is TRUE
, also calls the polygon
functionwith the x, y
coordinates in appropriate order.
If the no. of markers
is greater than 2, this number of markerswill be added to the curve, with equal distances measured along the curve.
Value
Plots the function graph and invisibly returns NULL
.
Note
fplot
is almost an alias for ezplot
as all ez...
will be replaced by MATLAB with function names f...
in 2017.
ezplot
should mimick the Matlab function of the same name, hasmore functionality, misses the possibility to plot several functions.
See Also
Examples
Example output
MATLAB Function Reference |
Easy to use function plotter
Syntax
Description
ezplot(f)
plots the expression f = f(x) over the default domain: -2 < x < 2.
ezplot(f,[min,max])
plots f = f(x) over the domain: min
< x <max
.
For implicitly defined functions, f = f(x,y):
ezplot(f)
plots f(x,y) = 0 over the default domain -2 < x < 2, -2 < y < 2.
ezplot(f,[xmin,xmax,ymin,ymax])
plots f(x,y) = 0 over xmin
< x < xmax
and ymin
< y < ymax
.
ezplot(f,[min,max])
plots f(x,y) = 0 over min
< x < max
and min
< y < max
.
If f is a function of the variables u and v (rather than x and y), then the domain endpoints umin, umax, vmin, and vmax are sorted alphabetically. Thus, ezplot('u^2 - v^2 - 1',[-3,2,-2,3])
plots u2 - v2 - 1 = 0 over -3 < u < 2, -2 < v < 3.
ezplot(x,y)
plots the parametrically defined planar curve x = x(t) and y = y(t) over the default domain 0 < t < 2.
ezplot(x,y,[tmin,tmax])
plots x = x(t) and y = y(t) over tmin
< t < tmax
.
ezplot(...,figure)
plots the given function over the specified domain in the figure window identified by the handle figure
.
Ezplot Vs Fplot
Remarks
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:
Ezplot Plot
That is, x^2
is interpreted as x.^2
in the string you pass to ezplot
.
Examples
This example plots the implicitly defined function,
- x2 - y4 = 0
over the domain [-2, 2]:
See Also
ezplot3
, ezpolar
, plot
Function Plots for related functions
ezmeshc | ezplot3 |