Fplot Octave
MATLAB Function Reference |
- Parametric Plot Octave
- Fplot Octave
- Plot Not Working Octave
- How To Plot Octave
- Sombrero Plot Octave
- 3d Plot Octave
- Plot Octave Options
Plot a function between specified limits
- The functions grid and box may also be used to add grid and border lines to the plot. By default, the grid is off and the border lines are on. Finally, arrows, text and rectangular or elliptic boxes can be added to highlight parts of a plot using the annotation function.
- Creates two figures, with the first displaying a sine wave and the second a cosine wave. Figure numbers must be positive integers. Figure figure n figure (n) figure (, 'property', value, ) h = figure. Create a new figure window for plotting.
Octave-Forge is a collection of packages providing extra functionality for GNU Octave. Ylabel, xlim, ylim, ezplot, errorbar, fplot, line, plot3, polar. Octave / Matlab: How to plot the roots of a polynomial. Ask Question Asked 10 years, 10 months ago. Active 10 years, 10 months ago. Viewed 10k times 5. Im trying to plot the roots of a polynomial, and i just cant get it. First i create my polynomial. P5 = 1 0 0 0 0 -1%x^5 - 1 r5 = roots(p5) stem (p5).
Syntax
Description
fplot
plots a function between specified limits. The function must be of the form y = f(x), where x is a vector whose range specifies the limits, and y
is a vector the same size as x
and contains the function's value at the points in x (see the first example). If the function returns more than one value for a given x, then y is a matrix whose columns contain each component of f(x) (see the second example).
fplot(fun,limits)
plots fun
between the limits specified by limits
. limits
is a vector specifying the x-axis limits ([xmin
xmax])
, or the x- and y-axes limits, ([xmin
xmax
ymin
ymax]
).
fun
must be
Parametric Plot Octave
- The name of an M-file function
- A string with variable
x
that may be passed toeval
, such as'sin(x)'
,'diric(x,10)'
, or'[sin(x),cos(x)]'
- A function handle for an M-file function or an anonymous function (see Function Handles and Anonymous Functions for more information)
The function f(x) must return a row vector for each element of vector x. For example, if f(x) returns [f1(x),f2(x),f3(x)]
then for input [x1;x2]
the function should return the matrix
fplot(
plots fun
,limits,LineSpec
)fun
using the line specification LineSpec
.
fplot(fun,limits,tol)
plots fun
using the relative error tolerance tol
(the default is 2e-3
, i.e., 0.2 percent accuracy).
fplot(fun,limits,tol,
plots LineSpec
)fun
using the relative error tolerance tol
and a line specification that determines line type, marker symbol, and color. See LineSpec
for more information.
fplot(fun,limits,n)
with n >= 1
plots the function with a minimum of n+1
points. The default n
is 1
. The maximum step size is restricted to be (1/n)*(xmax-xmin)
.
fplot(fun,lims,...)
accepts combinations of the optional arguments tol
, n
, and LineSpec
, in any order.
fplot(axes_handle,...)
plots into the axes with handle axes_handle
instead of the current axes (gca
).
[X,Y] = fplot(fun,limits,...)
returns the abscissas and ordinates for fun
in X
and Y
. No plot is drawn on the screen; however, you can plot the function using plot(X,Y)
.
Remarks
fplot
uses adaptive step control to produce a representative graph, concentrating its evaluation in regions where the function's rate of change is the greatest.
Examples
Plot the hyperbolic tangent function from -2 to 2:
Create an M-file, myfun
, that returns a two-column matrix:
Create a function handle pointing to myfun
:
Plot the function with the statement
Fplot Octave
Plot Not Working Octave
Addition Examples
This example passes function handles to fplot
, one created from a MATLAB function and the other created from an anonymous function.
See Also
eval
, ezplot
, feval
, LineSpec
, plot
Function Plots for related functions
How To Plot Octave
Plotting Mathematical Functions for more examples
Sombrero Plot Octave
3d Plot Octave
format | fprintf |
© 1994-2005 The MathWorks, Inc.