balance
-*- texinfo -*-
@deftypefn {Loadable Function} {@var{aa} =} balance (@var{a}, @var{opt})
@deftypefnx {Loadable Function} {[@var{dd}, @var{aa}] =} balance (@var{a}, @var{opt})
@deftypefnx {Loadable Function} {[@var{cc}, @var{dd}, @var{aa}, @var{bb}] =} balance (@var{a}, @var{b}, @var{opt})

@code{[dd, aa] = balance (a)} returns @code{aa = dd \ a * dd}.
@code{aa} is a matrix whose row and column norms are roughly equal in
magnitude, and @code{dd} = @code{p * d}, where @code{p} is a permutation
matrix and @code{d} is a diagonal matrix of powers of two.  This allows
the equilibration to be computed without roundoff.  Results of
eigenvalue calculation are typically improved by balancing first.

@code{[cc, dd, aa, bb] = balance (a, b)} returns @code{aa = cc*a*dd} and
@code{bb = cc*b*dd)}, where @code{aa} and @code{bb} have non-zero
elements of approximately the same magnitude and @code{cc} and @code{dd}
are permuted diagonal matrices as in @code{dd} for the algebraic
eigenvalue problem.

The eigenvalue balancing option @code{opt} is selected as follows:

@table @asis
@item @code{"N"}, @code{"n"}
No balancing; arguments copied, transformation(s) set to identity.

@item @code{"P"}, @code{"p"}
Permute argument(s) to isolate eigenvalues where possible.

@item @code{"S"}, @code{"s"}
Scale to improve accuracy of computed eigenvalues.

@item @code{"B"}, @code{"b"}
Permute and scale, in that order. Rows/columns of a (and b)
that are isolated by permutation are not scaled.  This is the default
behavior.
@end table

Algebraic eigenvalue balancing uses standard @sc{Lapack} routines.

Generalized eigenvalue problem balancing uses Ward's algorithm
(SIAM Journal on Scientific and Statistical Computing, 1981).
@end deftypefn
besselj
-*- texinfo -*-
@deftypefn {Loadable Function} {[@var{j}, @var{ierr}] =} besselj (@var{alpha}, @var{x}, @var{opt})
@deftypefnx {Loadable Function} {[@var{y}, @var{ierr}] =} bessely (@var{alpha}, @var{x}, @var{opt})
@deftypefnx {Loadable Function} {[@var{i}, @var{ierr}] =} besseli (@var{alpha}, @var{x}, @var{opt})
@deftypefnx {Loadable Function} {[@var{k}, @var{ierr}] =} besselk (@var{alpha}, @var{x}, @var{opt})
@deftypefnx {Loadable Function} {[@var{h}, @var{ierr}] =} besselh (@var{alpha}, @var{k}, @var{x}, @var{opt})
Compute Bessel or Hankel functions of various kinds:

@table @code
@item besselj
Bessel functions of the first kind.
@item bessely
Bessel functions of the second kind.
@item besseli
Modified Bessel functions of the first kind.
@item besselk
Modified Bessel functions of the second kind.
@item besselh
Compute Hankel functions of the first (@var{k} = 1) or second (@var{k}
 = 2) kind.
@end table

If the argument @var{opt} is supplied, the result is scaled by the
@code{exp (-I*@var{x})} for @var{k} = 1 or @code{exp (I*@var{x})} for
 @var{k} = 2.

If @var{alpha} is a scalar, the result is the same size as @var{x}.
If @var{x} is a scalar, the result is the same size as @var{alpha}.
If @var{alpha} is a row vector and @var{x} is a column vector, the
result is a matrix with @code{length (@var{x})} rows and
@code{length (@var{alpha})} columns.  Otherwise, @var{alpha} and
@var{x} must conform and the result will be the same size.

The value of @var{alpha} must be real.  The value of @var{x} may be
complex.

If requested, @var{ierr} contains the following status information
and is the same size as the result.

@enumerate 0
@item
Normal return.
@item
Input error, return @code{NaN}.
@item
Overflow, return @code{Inf}.
@item
Loss of significance by argument reduction results in less than
half of machine accuracy.
@item
Complete loss of significance by argument reduction, return @code{NaN}.
@item
Error---no computation, algorithm termination condition not met,
return @code{NaN}.
@end enumerate
@end deftypefn
bessely
-*- texinfo -*-
@deftypefn {Loadable Function} {[@var{y}, @var{ierr}] =} bessely (@var{alpha}, @var{x}, @var{opt})
See besselj.
@end deftypefn
besseli
-*- texinfo -*-
@deftypefn {Loadable Function} {[@var{i}, @var{ierr}] =} besseli (@var{alpha}, @var{x}, @var{opt})
See besselj.
@end deftypefn
besselk
-*- texinfo -*-
@deftypefn {Loadable Function} {[@var{k}, @var{ierr}] =} besselk (@var{alpha}, @var{x}, @var{opt})
See besselj.
@end deftypefn
besselh
-*- texinfo -*-
@deftypefn {Loadable Function} {[@var{h}, @var{ierr}] =} besselh (@var{alpha}, @var{k}, @var{x}, @var{opt})
See besselj.
@end deftypefn
airy
-*- texinfo -*-
@deftypefn {Loadable Function} {[@var{a}, @var{ierr}] =} airy (@var{k}, @var{z}, @var{opt})
Compute Airy functions of the first and second kind, and their
derivatives.

@example
  K   Function   Scale factor (if a third argument is supplied)
 ---  --------   ----------------------------------------------
  0   Ai (Z)     exp ((2/3) * Z * sqrt (Z))
  1   dAi(Z)/dZ  exp ((2/3) * Z * sqrt (Z))
  2   Bi (Z)     exp (-abs (real ((2/3) * Z *sqrt (Z))))
  3   dBi(Z)/dZ  exp (-abs (real ((2/3) * Z *sqrt (Z))))
@end example

The function call @code{airy (@var{z})} is equivalent to
@code{airy (0, @var{z})}.

The result is the same size as @var{z}.

If requested, @var{ierr} contains the following status information and
is the same size as the result.

@enumerate 0
@item
Normal return.
@item
Input error, return @code{NaN}.
@item
Overflow, return @code{Inf}.
@item
Loss of significance by argument reduction results in less than half
 of machine accuracy.
@item
Complete loss of significance by argument reduction, return @code{NaN}.
@item
Error---no computation, algorithm termination condition not met,
return @code{NaN}
@end enumerate
@end deftypefn
betainc
-*- texinfo -*-
@deftypefn {Mapping Function} {} betainc (@var{x}, @var{a}, @var{b})
Return the incomplete Beta function,
@iftex
@tex
$$
 \beta (a, b, x) = B (a, b)^{-1} \int_0^x t^{(a-z)} (1-t)^{(b-1)} dt.
$$
@end tex
@end iftex
@ifinfo

@smallexample
                                    x
                                   /
betai (a, b, x) = beta (a, b)^(-1) | t^(a-1) (1-t)^(b-1) dt.
                                   /
                                t=0
@end smallexample
@end ifinfo

If x has more than one component, both @var{a} and @var{b} must be
scalars.  If @var{x} is a scalar, @var{a} and @var{b} must be of
compatible dimensions.
@end deftypefn
chol
-*- texinfo -*-
@deftypefn {Loadable Function} {} chol (@var{a})
@cindex Cholesky factorization
Compute the Cholesky factor, @var{r}, of the symmetric positive definite
matrix @var{a}, where
@iftex
@tex
$ R^T R = A $.
@end tex
@end iftex
@ifinfo

@example
r' * r = a.
@end example
@end ifinfo
@end deftypefn
colloc
-*- texinfo -*-
@deftypefn {Loadable Function} {[@var{r}, @var{amat}, @var{bmat}, @var{q}] =} colloc (@var{n}, "left", "right")
Compute derivative and integral weight matrices for orthogonal
collocation using the subroutines given in J. Villadsen and
M. L. Michelsen, @cite{Solution of Differential Equation Models by
Polynomial Approximation}.
@end deftypefn
daspk_options
-*- texinfo -*-
@deftypefn {Loadable Function} {} daspk_options (@var{opt}, @var{val})
When called with two arguments, this function
allows you set options parameters for the function @code{daspk}.
Given one argument, @code{daspk_options} returns the value of the
corresponding option.  If no arguments are supplied, the names of all
the available options and their current values are displayed.

Options include

@table @code
@item "absolute tolerance"
Absolute tolerance.  May be either vector or scalar.  If a vector, it
must match the dimension of the state vector, and the relative
tolerance must also be a vector of the same length.
@item "relative tolerance"
Relative tolerance.  May be either vector or scalar.  If a vector, it
must match the dimension of the state vector, and the absolute
tolerance must also be a vector of the same length.

The local error test applied at each integration step is

@example
  abs (local error in x(i)) <= rtol(i) * abs (Y(i)) + atol(i)
@end example
@item "compute consistent initial condition"
Denoting the differential variables in the state vector by @samp{Y_d}
and the algebraic variables by @samp{Y_a}, @code{ddaspk} can solve
one of two initialization problems:

@enumerate
@item Given Y_d, calculate Y_a and Y'_d
@item Given Y', calculate Y.
@end enumerate

In either case, initial values for the given components are input, and
initial guesses for the unknown components must also be provided as
input.  Set this option to 1 to solve the first problem, or 2 to solve
the second (the default default is 0, so you must provide a set of
initial conditions that are consistent).

If this option is set to a nonzero value, you must also set the
@code{"algebraic variables"} option to declare which variables in the
problem are algebraic.
@item "use initial condition heuristics"
Set to a nonzero value to use the initial condition heuristics options
described below.
@item "initial condition heuristics"
A vector of the following parameters that can be used to control the
initial condition calculation.

@table @code
@item MXNIT
Maximum number of Newton iterations (default is 5).
@item MXNJ
Maximum number of Jacobian evaluations (default is 6).
@item MXNH
Maximum number of values of the artificial stepsize parameter to be
tried if the @code{"compute consistent initial condition"} option has
been set to 1 (default is 5).

Note that the maximum number of Newton iterations allowed in all is
@code{MXNIT*MXNJ*MXNH} if the @code{"compute consistent initial
condition"} option has been set to 1 and @code{MXNIT*MXNJ} if it is
set to 2.
@item LSOFF
Set to a nonzero value to disable the linesearch algorithm (default is
0).
@item STPTOL
Minimum scaled step in linesearch algorithm (default is eps^(2/3)).
@item EPINIT
Swing factor in the Newton iteration convergence test.  The test is
applied to the residual vector, premultiplied by the approximate
Jacobian.  For convergence, the weighted RMS norm of this vector
(scaled by the error weights) must be less than @code{EPINIT*EPCON},
where @code{EPCON} = 0.33 is the analogous test constant used in the
time steps. The default is @code{EPINIT} = 0.01.
@end table
@item "print initial condition info"
Set this option to a nonzero value to display detailed information
about the initial condition calculation (default is 0).
@item "exclude algebraic variables from error test"
Set to a nonzero value to exclude algebraic variables from the error
test.  You must also set the @code{"algebraic variables"} option to
declare which variables in the problem are algebraic (default is 0).
@item "algebraic variables"
A vector of the same length as the state vector.  A nonzero element
indicates that the corresponding element of the state vector is an
algebraic variable (i.e., its derivative does not appear explicitly
in the equation set.

This option is required by the
@code{compute consistent initial condition"} and
@code{"exclude algebraic variables from error test"} options.
@item "enforce inequality constraints"
Set to one of the following values to enforce the inequality
constraints specified by the @code{"inequality constraint types"}
option (default is 0).

@enumerate
@item To have constraint checking only in the initial condition calculation.
@item To enforce constraint checking during the integration.
@item To enforce both options 1 and 2.
@end enumerate
@item "inequality constraint types"
A vector of the same length as the state specifying the type of
inequality constraint.  Each element of the vector corresponds to an
element of the state and should be assigned one of the following
codes 

@table @asis
@item -2
Less than zero.
@item -1
Less than or equal to zero.
@item 0
Not constrained.
@item 1
Greater than or equal to zero.
@item 2
Greater than zero.
@end table

This option only has an effect if the
@code{"enforce inequality constraints"} option is nonzero.
@item "initial step size"
Differential-algebraic problems may occaisionally suffer from severe
scaling difficulties on the first step.  If you know a great deal
about the scaling of your problem, you can help to alleviate this
problem by specifying an initial stepsize (default is computed
automatically).
@item "maximum order"
Restrict the maximum order of the solution method.  This option must
be between 1 and 5, inclusive (default is 5).
@item "maximum step size"
Setting the maximum stepsize will avoid passing over very large
regions (default is not specified).
@end table
@end deftypefn
daspk
-*- texinfo -*-
@deftypefn {Loadable Function} {[@var{x}, @var{xdot}, @var{istate}, @var{msg}] =} daspk (@var{fcn}, @var{x_0}, @var{xdot_0}, @var{t}, @var{t_crit})
Solve the set of differential-algebraic equations
@tex
$$ 0 = f (\dot{x}, x, t) $$
with
$$ x(t_0) = x_0, \dot{x}(t_0) = \dot{x}_0 $$
@end tex
@ifinfo

@example
0 = f (x, xdot, t)
@end example

with

@example
x(t_0) = x_0, xdot(t_0) = xdot_0
@end example

@end ifinfo
The solution is returned in the matrices @var{x} and @var{xdot},
with each row in the result matrices corresponding to one of the
elements in the vector @var{t}.  The first element of @var{t}
should be @math{t_0} and correspond to the initial state of the
system @var{x_0} and its derivative @var{xdot_0}, so that the first
row of the output @var{x} is @var{x_0} and the first row
of the output @var{xdot} is @var{xdot_0}.

The first argument, @var{fcn}, is a string that names the function to
call to compute the vector of residuals for the set of equations.
It must have the form

@example
@var{res} = f (@var{x}, @var{xdot}, @var{t})
@end example

@noindent
in which @var{x}, @var{xdot}, and @var{res} are vectors, and @var{t} is a
scalar.

If @var{fcn} is a two-element string array, the first element names
the function @math{f} described above, and the second element names
a function to compute the modified Jacobian
@tex
$$
J = {\partial f \over \partial x}
  + c {\partial f \over \partial \dot{x}}
$$
@end tex
@ifinfo

@example
      df       df
jac = -- + c ------
      dx     d xdot
@end example
@end ifinfo

The modified Jacobian function must have the form

@example

@var{jac} = j (@var{x}, @var{xdot}, @var{t}, @var{c})

@end example

The second and third arguments to @code{daspk} specify the initial
condition of the states and their derivatives, and the fourth argument
specifies a vector of output times at which the solution is desired,
including the time corresponding to the initial condition.

The set of initial states and derivatives are not strictly required to
be consistent.  If they are not consistent, you must use the
@code{daspk_options} function to provide additional information so
that @code{daspk} can compute a consistent starting point.

The fifth argument is optional, and may be used to specify a set of
times that the DAE solver should not integrate past.  It is useful for
avoiding difficulties with singularities and points where there is a
discontinuity in the derivative.

After a successful computation, the value of @var{istate} will be
greater than zero (consistent with the Fortran version of @sc{Daspk}).

If the computation is not successful, the value of @var{istate} will be
less than zero and @var{msg} will contain additional information.

You can use the function @code{daspk_options} to set optional
parameters for @code{daspk}.
@end deftypefn
@seealso{dassl}
dasrt_options
-*- texinfo -*-
@deftypefn {Loadable Function} {} dasrt_options (@var{opt}, @var{val})
When called with two arguments, this function
allows you set options parameters for the function @code{dasrt}.
Given one argument, @code{dasrt_options} returns the value of the
corresponding option.  If no arguments are supplied, the names of all
the available options and their current values are displayed.

Options include

@table @code
@item "absolute tolerance"
Absolute tolerance.  May be either vector or scalar.  If a vector, it
must match the dimension of the state vector, and the relative
tolerance must also be a vector of the same length.
@item "relative tolerance"
Relative tolerance.  May be either vector or scalar.  If a vector, it
must match the dimension of the state vector, and the absolute
tolerance must also be a vector of the same length.

The local error test applied at each integration step is
@example
  abs (local error in x(i)) <= rtol(i) * abs (Y(i)) + atol(i)
@end example
@item "initial step size"
Differential-algebraic problems may occaisionally suffer from severe
scaling difficulties on the first step.  If you know a great deal
about the scaling of your problem, you can help to alleviate this
problem by specifying an initial stepsize.
@item "maximum order"
Restrict the maximum order of the solution method.  This option must
be between 1 and 5, inclusive.
@item "maximum step size"
Setting the maximum stepsize will avoid passing over very large
regions.
@item "step limit"
Maximum number of integration steps to attempt on a single call to the
underlying Fortran code.
@end table
@end deftypefn
dasrt
-*- texinfo -*-
@deftypefn {Loadable Function} {[@var{x}, @var{xdot}, @var{t_out}, @var{istat}, @var{msg}] =} dasrt (@var{fcn} [, @var{g}], @var{x_0}, @var{xdot_0}, @var{t} [, @var{t_crit}])
Solve the set of differential-algebraic equations
@tex
$$ 0 = f (\dot{x}, x, t) $$
with
$$ x(t_0) = x_0, \dot{x}(t_0) = \dot{x}_0 $$
@end tex
@ifinfo

@example
0 = f (xdot, x, t)
@end example

with

@example
x(t_0) = x_0, xdot(t_0) = xdot_0
@end example

@end ifinfo
with functional stopping criteria (root solving).

The solution is returned in the matrices @var{x} and @var{xdot},
with each row in the result matrices corresponding to one of the
elements in the vector @var{t_out}.  The first element of @var{t}
should be @math{t_0} and correspond to the initial state of the
system @var{x_0} and its derivative @var{xdot_0}, so that the first
row of the output @var{x} is @var{x_0} and the first row
of the output @var{xdot} is @var{xdot_0}.

The vector @var{t} provides an upper limit on the length of the
integration.  If the stopping condition is met, the vector
@var{t_out} will be shorter than @var{t}, and the final element of
@var{t_out} will be the point at which the stopping condition was met,
and may not correspond to any element of the vector @var{t}.

The first argument, @var{fcn}, is a string that names the function to
call to compute the vector of residuals for the set of equations.
It must have the form

@example
@var{res} = f (@var{x}, @var{xdot}, @var{t})
@end example

@noindent
in which @var{x}, @var{xdot}, and @var{res} are vectors, and @var{t} is a
scalar.

If @var{fcn} is a two-element string array, the first element names
the function @math{f} described above, and the second element names
a function to compute the modified Jacobian

@tex
$$
J = {\partial f \over \partial x}
  + c {\partial f \over \partial \dot{x}}
$$
@end tex
@ifinfo

@example
      df       df
jac = -- + c ------
      dx     d xdot
@end example

@end ifinfo

The modified Jacobian function must have the form

@example

@var{jac} = j (@var{x}, @var{xdot}, @var{t}, @var{c})

@end example

The optional second argument names a function that defines the
constraint functions whose roots are desired during the integration.
This function must have the form

@example
@var{g_out} = g (@var{x}, @var{t})
@end example

and return a vector of the constraint function values.
If the value of any of the constraint functions changes sign, @sc{Dasrt}
will attempt to stop the integration at the point of the sign change.

If the name of the constraint function is omitted, @code{dasrt} solves
the saem problem as @code{daspk} or @code{dassl}.

Note that because of numerical errors in the constraint functions
due to roundoff and integration error, @sc{Dasrt} may return false
roots, or return the same root at two or more nearly equal values of
@var{T}.  If such false roots are suspected, the user should consider
smaller error tolerances or higher precision in the evaluation of the
constraint functions.

If a root of some constraint function defines the end of the problem,
the input to @sc{Dasrt} should nevertheless allow integration to a
point slightly past that root, so that @sc{Dasrt} can locate the root
by interpolation.

The third and fourth arguments to @code{dasrt} specify the initial
condition of the states and their derivatives, and the fourth argument
specifies a vector of output times at which the solution is desired,
including the time corresponding to the initial condition.

The set of initial states and derivatives are not strictly required to
be consistent.  In practice, however, @sc{Dassl} is not very good at
determining a consistent set for you, so it is best if you ensure that
the initial values result in the function evaluating to zero.

The sixth argument is optional, and may be used to specify a set of
times that the DAE solver should not integrate past.  It is useful for
avoiding difficulties with singularities and points where there is a
discontinuity in the derivative.

After a successful computation, the value of @var{istate} will be
greater than zero (consistent with the Fortran version of @sc{Dassl}).

If the computation is not successful, the value of @var{istate} will be
less than zero and @var{msg} will contain additional information.

You can use the function @code{dasrt_options} to set optional
parameters for @code{dasrt}.
@end deftypefn
@seealso{daspk, dasrt, lsode, odessa}
dassl_options
-*- texinfo -*-
@deftypefn {Loadable Function} {} dassl_options (@var{opt}, @var{val})
When called with two arguments, this function
allows you set options parameters for the function @code{dassl}.
Given one argument, @code{dassl_options} returns the value of the
corresponding option.  If no arguments are supplied, the names of all
the available options and their current values are displayed.

Options include

@table @code
@item "absolute tolerance"
Absolute tolerance.  May be either vector or scalar.  If a vector, it
must match the dimension of the state vector, and the relative
tolerance must also be a vector of the same length.
@item "relative tolerance"
Relative tolerance.  May be either vector or scalar.  If a vector, it
must match the dimension of the state vector, and the absolute
tolerance must also be a vector of the same length.

The local error test applied at each integration step is

@example
  abs (local error in x(i)) <= rtol(i) * abs (Y(i)) + atol(i)
@end example
@item "compute consistent initial condition"
If nonzero, @code{dassl} will attempt to compute a consistent set of intial
conditions.  This is generally not reliable, so it is best to provide
a consistent set and leave this option set to zero.
@item "enforce nonnegativity constraints"
If you know that the solutions to your equations will always be
nonnegative, it may help to set this parameter to a nonzero
value.  However, it is probably best to try leaving this option set to
zero first, and only setting it to a nonzero value if that doesn't
work very well.
@item "initial step size"
Differential-algebraic problems may occaisionally suffer from severe
scaling difficulties on the first step.  If you know a great deal
about the scaling of your problem, you can help to alleviate this
problem by specifying an initial stepsize.
@item "maximum order"
Restrict the maximum order of the solution method.  This option must
be between 1 and 5, inclusive.
@item "maximum step size"
Setting the maximum stepsize will avoid passing over very large
regions  (default is not specified).
@item "step limit"
Maximum number of integration steps to attempt on a single call to the
underlying Fortran code.
@end table
@end deftypefn
dassl
-*- texinfo -*-
@deftypefn {Loadable Function} {[@var{x}, @var{xdot}, @var{istate}, @var{msg}] =} dassl (@var{fcn}, @var{x_0}, @var{xdot_0}, @var{t}, @var{t_crit})
Solve the set of differential-algebraic equations
@tex
$$ 0 = f (\dot{x}, x, t) $$
with
$$ x(t_0) = x_0, \dot{x}(t_0) = \dot{x}_0 $$
@end tex
@ifinfo

@example
0 = f (x, xdot, t)
@end example

with

@example
x(t_0) = x_0, xdot(t_0) = xdot_0
@end example

@end ifinfo
The solution is returned in the matrices @var{x} and @var{xdot},
with each row in the result matrices corresponding to one of the
elements in the vector @var{t}.  The first element of @var{t}
should be @math{t_0} and correspond to the initial state of the
system @var{x_0} and its derivative @var{xdot_0}, so that the first
row of the output @var{x} is @var{x_0} and the first row
of the output @var{xdot} is @var{xdot_0}.

The first argument, @var{fcn}, is a string that names the function to
call to compute the vector of residuals for the set of equations.
It must have the form

@example
@var{res} = f (@var{x}, @var{xdot}, @var{t})
@end example

@noindent
in which @var{x}, @var{xdot}, and @var{res} are vectors, and @var{t} is a
scalar.

If @var{fcn} is a two-element string array, the first element names
the function @math{f} described above, and the second element names
a function to compute the modified Jacobian

@tex
$$
J = {\partial f \over \partial x}
  + c {\partial f \over \partial \dot{x}}
$$
@end tex
@ifinfo
      df       df
jac = -- + c ------
      dx     d xdot
@example
@end example

@end ifinfo

The modified Jacobian function must have the form

@example

@var{jac} = j (@var{x}, @var{xdot}, @var{t}, @var{c})

@end example

The second and third arguments to @code{dassl} specify the initial
condition of the states and their derivatives, and the fourth argument
specifies a vector of output times at which the solution is desired,
including the time corresponding to the initial condition.

The set of initial states and derivatives are not strictly required to
be consistent.  In practice, however, @sc{Dassl} is not very good at
determining a consistent set for you, so it is best if you ensure that
the initial values result in the function evaluating to zero.

The fifth argument is optional, and may be used to specify a set of
times that the DAE solver should not integrate past.  It is useful for
avoiding difficulties with singularities and points where there is a
discontinuity in the derivative.

After a successful computation, the value of @var{istate} will be
greater than zero (consistent with the Fortran version of @sc{Dassl}).

If the computation is not successful, the value of @var{istate} will be
less than zero and @var{msg} will contain additional information.

You can use the function @code{dassl_options} to set optional
parameters for @code{dassl}.
@end deftypefn
@seealso{daspk, dasrt, lsode, odessa}
all
-*- texinfo -*-
@deftypefn {Built-in Function} {} all (@var{x}, @var{dim})
The function @code{all} behaves like the function @code{any}, except
that it returns true only if all the elements of a vector, or all the
elements along dimension @var{dim} of a matrix, are nonzero.
@end deftypefn
any
-*- texinfo -*-
@deftypefn {Built-in Function} {} any (@var{x}, @var{dim})
For a vector argument, return 1 if any element of the vector is
nonzero.

For a matrix argument, return a row vector of ones and
zeros with each element indicating whether any of the elements of the
corresponding column of the matrix are nonzero.  For example,

@example
@group
any (eye (2, 4))
     @result{} [ 1, 1, 0, 0 ]
@end group
@end example

If the optional argument @var{dim} is supplied, work along dimension
@var{dim}.  For example,

@example
@group
any (eye (2, 4), 2)
     @result{} [ 1; 1 ]
@end group
@end example
@end deftypefn
atan2
-*- texinfo -*-
@deftypefn {Mapping Function} {} atan2 (@var{y}, @var{x})
Compute atan (@var{y} / @var{x}) for corresponding elements of @var{y}
and @var{x}.  The result is in range -pi to pi.
@end deftypefn
fmod
-*- texinfo -*-
@deftypefn {Mapping Function} {} fmod (@var{x}, @var{y})
Compute the floating point remainder of dividing @var{x} by @var{y}
using the C library function @code{fmod}.  The result has the same
sign as @var{x}.  If @var{y} is zero, the result implementation-defined.
@end deftypefn
cumprod
-*- texinfo -*-
@deftypefn {Built-in Function} {} cumprod (@var{x}, @var{dim})
Cumulative product of elements along dimension @var{dim}.  If
@var{dim} is omitted, it defaults to 1 (column-wise cumulative
products).
@end deftypefn
cumsum
-*- texinfo -*-
@deftypefn {Built-in Function} {} cumsum (@var{x}, @var{dim})
Cumulative sum of elements along dimension @var{dim}.  If @var{dim}
is omitted, it defaults to 1 (column-wise cumulative sums).
@end deftypefn
diag
-*- texinfo -*-
@deftypefn {Built-in Function} {} diag (@var{v}, @var{k})
Return a diagonal matrix with vector @var{v} on diagonal @var{k}.  The
second argument is optional.  If it is positive, the vector is placed on
the @var{k}-th super-diagonal.  If it is negative, it is placed on the
@var{-k}-th sub-diagonal.  The default value of @var{k} is 0, and the
vector is placed on the main diagonal.  For example,

@example
@group
diag ([1, 2, 3], 1)
     @result{}  0  1  0  0
         0  0  2  0
         0  0  0  3
         0  0  0  0
@end group
@end example
@end deftypefn
prod
-*- texinfo -*-
@deftypefn {Built-in Function} {} prod (@var{x}, @var{dim})
Product of elements along dimension @var{dim}.  If @var{dim} is
omitted, it defaults to 1 (column-wise products).
@end deftypefn
horzcat
-*- texinfo -*-
@deftypefn {Built-in Function} {} horzcat (@var{array1}, @var{array2}, @dots{}, @var{arrayN})
Return the horizontal concatenation of N-d array objects, @var{array1},
@var{array2}, @dots{}, @var{arrayN} along dimension 2.
@end deftypefn
@seealso{cat and vertcat}
vertcat
-*- texinfo -*-
@deftypefn {Built-in Function} {} vertcat (@var{array1}, @var{array2}, @dots{}, @var{arrayN})
Return the vertical concatenation of N-d array objects, @var{array1},
@var{array2}, @dots{}, @var{arrayN} along dimension 1.
@end deftypefn
@seealso{cat and horzcat}
cat
-*- texinfo -*-
@deftypefn {Built-in Function} {} cat (@var{dim}, @var{array1}, @var{array2}, @dots{}, @var{arrayN})
Return the concatenation of N-d array objects, @var{array1},
@var{array2}, @dots{}, @var{arrayN} along dimension @var{dim}.

@example
@group
A = ones (2, 2);
B = zeros (2, 2);
cat (2, A, B)
@result{} ans =

     1 1 0 0
     1 1 0 0
     1 1 0 0
     1 1 0 0
@end group
@end example

Alternatively, we can concatenate @var{A} and @var{B} along the
second dimension the following way:

@example
@group
[A, B].
@end group
@end example

@var{dim} can be larger than the dimensions of the N-d array objects
and the result will thus have @var{dim} dimensions as the
following example shows:
@example
@group
cat (4, ones(2, 2), zeros (2, 2))
@result{} ans =

   ans(:,:,1,1) =

     1 1
     1 1

   ans(:,:,1,2) =
     0 0
     0 0
@end group
@end example

@end deftypefn
@seealso{horzcat and vertcat}
permute
-*- texinfo -*-
@deftypefn {Built-in Function} {} permute (@var{a}, @var{perm})
Return the generalized transpose for an N-d array object @var{a}.
The permutation vector @var{perm} must contain the elements
@code{1:ndims(a)} (in any order, but each element must appear just once).

@end deftypefn
@seealso{ipermute}
ipermute
-*- texinfo -*-
@deftypefn {Built-in Function} {} ipermute (@var{a}, @var{iperm})
The inverse of the @code{permute} function.  The expression

@example
ipermute (permute (a, perm), perm)
@end example
returns the original array @var{a}.

@end deftypefn
@seealso{permute}
length
-*- texinfo -*-
@deftypefn {Built-in Function} {} length (@var{a})
Return the `length' of the object @var{a}.  For matrix objects, the
length is the number of rows or columns, whichever is greater (this
odd definition is used for compatibility with Matlab).
@end deftypefn
ndims
-*- texinfo -*-
@deftypefn {Built-in Function} {} ndims (@var{a})
Returns the number of dimensions of array @var{a}.
For any array, the result will always be larger than or equal to 2.
Trailing singleton dimensions are not counted.
@end deftypefn
numel
-*- texinfo -*-
@deftypefn {Built-in Function} {} numel (@var{a})
Returns the number of elements in the object @var{a}.
@end deftypefn
size
-*- texinfo -*-
@deftypefn {Built-in Function} {} size (@var{a}, @var{n})
Return the number rows and columns of @var{a}.

With one input argument and one output argument, the result is returned
in a row vector.  If there are multiple output arguments, the number of
rows is assigned to the first, and the number of columns to the second,
etc.  For example,

@example
@group
size ([1, 2; 3, 4; 5, 6])
     @result{} [ 3, 2 ]

[nr, nc] = size ([1, 2; 3, 4; 5, 6])
     @result{} nr = 3
     @result{} nc = 2
@end group
@end example

If given a second argument, @code{size} will return the size of the
corresponding dimension.  For example

@example
size ([1, 2; 3, 4; 5, 6], 2)
     @result{} 2
@end example

@noindent
returns the number of columns in the given matrix.
@end deftypefn
sum
-*- texinfo -*-
@deftypefn {Built-in Function} {} sum (@var{x}, @var{dim})
Sum of elements along dimension @var{dim}.  If @var{dim} is
omitted, it defaults to 1 (column-wise sum).
@end deftypefn
sumsq
-*- texinfo -*-
@deftypefn {Built-in Function} {} sumsq (@var{x}, @var{dim})
Sum of squares of elements along dimension @var{dim}.  If @var{dim}
is omitted, it defaults to 1 (column-wise sum of squares).

This function is equivalent to computing
@example
sum (x .* conj (x), dim)
@end example
but it uses less memory and avoids calling conj if @var{x} is real.
@end deftypefn
isbool
-*- texinfo -*-
@deftypefn {Built-in Functio} {} isbool (@var{x})
Return true if @var{x} is a boolean object.
@end deftypefn
iscomplex
-*- texinfo -*-
@deftypefn {Built-in Function} {} iscomplex (@var{x})
Return true if @var{x} is a complex-valued numeric object.
@end deftypefn
isreal
-*- texinfo -*-
@deftypefn {Built-in Function} {} isreal (@var{x})
Return true if @var{x} is a real-valued numeric object.
@end deftypefn
isempty
-*- texinfo -*-
@deftypefn {Built-in Function} {} isempty (@var{a})
Return 1 if @var{a} is an empty matrix (either the number of rows, or
the number of columns, or both are zero).  Otherwise, return 0.
@end deftypefn
isnumeric
-*- texinfo -*-
@deftypefn {Built-in Function} {} isnumeric (@var{x})
Return nonzero if @var{x} is a numeric object.
@end deftypefn
islist
-*- texinfo -*-
@deftypefn {Built-in Function} {} islist (@var{x})
Return nonzero if @var{x} is a list.
@end deftypefn
ismatrix
-*- texinfo -*-
@deftypefn {Built-in Function} {} ismatrix (@var{a})
Return 1 if @var{a} is a matrix.  Otherwise, return 0.
@end deftypefn
ones
-*- texinfo -*-
@deftypefn {Built-in Function} {} ones (@var{x})
@deftypefnx {Built-in Function} {} ones (@var{n}, @var{m})
@deftypefnx {Built-in Function} {} ones (@var{n}, @var{m}, @var{k},...)
Return a matrix or N-dimensional array whose elements are all 1.
The arguments are handled the same as the arguments for @code{eye}.

If you need to create a matrix whose values are all the same, you should
use an expression like

@example
val_matrix = val * ones (n, m)
@end example
@end deftypefn
zeros
-*- texinfo -*-
@deftypefn {Built-in Function} {} zeros (@var{x})
@deftypefnx {Built-in Function} {} zeros (@var{n}, @var{m})
@deftypefnx {Built-in Function} {} zeros (@var{n}, @var{m}, @var{k},...)
Return a matrix or N-dimensional array whose elements are all 0.
The arguments are handled the same as the arguments for @code{eye}.
@end deftypefn
eye
-*- texinfo -*-
@deftypefn {Built-in Function} {} eye (@var{x})
@deftypefnx {Built-in Function} {} eye (@var{n}, @var{m})
Return an identity matrix.  If invoked with a single scalar argument,
@code{eye} returns a square matrix with the dimension specified.  If you
supply two scalar arguments, @code{eye} takes them to be the number of
rows and columns.  If given a vector with two elements, @code{eye} uses
the values of the elements as the number of rows and columns,
respectively.  For example,

@example
@group
eye (3)
     @result{}  1  0  0
         0  1  0
         0  0  1
@end group
@end example

The following expressions all produce the same result:

@example
@group
eye (2)
@equiv{}
eye (2, 2)
@equiv{}
eye (size ([1, 2; 3, 4])
@end group
@end example

For compatibility with @sc{Matlab}, calling @code{eye} with no arguments
is equivalent to calling it with an argument of 1.
@end deftypefn
linspace
-*- texinfo -*-
@deftypefn {Built-in Function} {} linspace (@var{base}, @var{limit}, @var{n})
Return a row vector with @var{n} linearly spaced elements between
@var{base} and @var{limit}.  The number of elements, @var{n}, must be
greater than 1.  The @var{base} and @var{limit} are always included in
the range.  If @var{base} is greater than @var{limit}, the elements are
stored in decreasing order.  If the number of points is not specified, a
value of 100 is used.

The @code{linspace} function always returns a row vector.
@end deftypefn
reshape
-*- texinfo -*-
@deftypefn {Function File} {} reshape (@var{a}, @var{m}, @var{n}, @dots{})
@deftypefnx {Function File} {} reshape (@var{a}, @var{siz})
Return a matrix with the given dimensions whose elements are taken
from the matrix @var{a}.  The elements of the matrix are access in
column-major order (like Fortran arrays are stored).

For example,

@example
@group
reshape ([1, 2, 3, 4], 2, 2)
     @result{}  1  3
         2  4
@end group
@end example

@noindent
Note that the total number of elements in the original
matrix must match the total number of elements in the new matrix.
@end deftypefn
squeeze
-*- texinfo -*-
@deftypefn {Built-in Function} {} squeeze (@var{x})
Remove singleton dimensions from @var{x} and return the result.
@end deftypefn
I
-*- texinfo -*-
@defvr {Built-in Variable} I
@defvrx {Built-in Variable} J
@defvrx {Built-in Variable} i
@defvrx {Built-in Variable} j
A pure imaginary number, defined as
@iftex
@tex
  $\sqrt{-1}$.
@end tex
@end iftex
@ifinfo
  @code{sqrt (-1)}.
@end ifinfo
The @code{I} and @code{J} forms are true constants, and cannot be
modified.  The @code{i} and @code{j} forms are like ordinary variables,
and may be used for other purposes.  However, unlike other variables,
they once again assume their special predefined values if they are
cleared @xref{Status of Variables}.
@end defvr
Inf
-*- texinfo -*-
@defvr {Built-in Variable} Inf
@defvrx {Built-in Variable} inf
Infinity.  This is the result of an operation like 1/0, or an operation
that results in a floating point overflow.
@end defvr
J
-*- texinfo -*-
@defvr {Built-in Variable} I
@defvrx {Built-in Variable} J
@defvrx {Built-in Variable} i
@defvrx {Built-in Variable} j
A pure imaginary number, defined as
@iftex
@tex
  $\sqrt{-1}$.
@end tex
@end iftex
@ifinfo
  @code{sqrt (-1)}.
@end ifinfo
The @code{I} and @code{J} forms are true constants, and cannot be
modified.  The @code{i} and @code{j} forms are like ordinary variables,
and may be used for other purposes.  However, unlike other variables,
they once again assume their special predefined values if they are
cleared @xref{Status of Variables}.
@end defvr
NA
-*- texinfo -*-
@defvr {Built-in Variable} NA
Missing value.
@end defvr
NaN
-*- texinfo -*-
@defvr {Built-in Variable} NaN
@defvrx {Built-in Variable} nan
Not a number.  This is the result of an operation like
@iftex
@tex
$0/0$, or $\infty - \infty$,
@end tex
@end iftex
@ifinfo
0/0, or @samp{Inf - Inf},
@end ifinfo
or any operation with a NaN.

Note that NaN always compares not equal to NaN.  This behavior is
specified by the IEEE standard for floating point arithmetic.  To
find NaN values, you must use the @code{isnan} function.
@end defvr
e
-*- texinfo -*-
@defvr {Built-in Variable} e
The base of natural logarithms.  The constant
@iftex
@tex
 $e$
@end tex
@end iftex
@ifinfo
 @var{e}
@end ifinfo
 satisfies the equation
@iftex
@tex
 $\log (e) = 1$.
@end tex
@end iftex
@ifinfo
 @code{log} (@var{e}) = 1.
@end ifinfo
@end defvr
eps
-*- texinfo -*-
@defvr {Built-in Variable} eps
The machine precision.  More precisely, @code{eps} is the largest
relative spacing between any two adjacent numbers in the machine's
floating point system.  This number is obviously system-dependent.  On
machines that support 64 bit IEEE floating point arithmetic, @code{eps}
is approximately
@ifinfo
 2.2204e-16.
@end ifinfo
@iftex
@tex
 $2.2204\times10^{-16}$.
@end tex
@end iftex
@end defvr
false
-*- texinfo -*-
@defvr {Built-in Variable} false
Logical false value.
@end defvr
i
-*- texinfo -*-
@defvr {Built-in Variable} I
@defvrx {Built-in Variable} J
@defvrx {Built-in Variable} i
@defvrx {Built-in Variable} j
A pure imaginary number, defined as
@iftex
@tex
  $\sqrt{-1}$.
@end tex
@end iftex
@ifinfo
  @code{sqrt (-1)}.
@end ifinfo
The @code{I} and @code{J} forms are true constants, and cannot be
modified.  The @code{i} and @code{j} forms are like ordinary variables,
and may be used for other purposes.  However, unlike other variables,
they once again assume their special predefined values if they are
cleared @xref{Status of Variables}.
@end defvr
inf
-*- texinfo -*-
@defvr {Built-in Variable} Inf
@defvrx {Built-in Variable} inf
Infinity.  This is the result of an operation like 1/0, or an operation
that results in a floating point overflow.
@end defvr
j
-*- texinfo -*-
@defvr {Built-in Variable} I
@defvrx {Built-in Variable} J
@defvrx {Built-in Variable} i
@defvrx {Built-in Variable} j
A pure imaginary number, defined as
@iftex
@tex
  $\sqrt{-1}$.
@end tex
@end iftex
@ifinfo
  @code{sqrt (-1)}.
@end ifinfo
The @code{I} and @code{J} forms are true constants, and cannot be
modified.  The @code{i} and @code{j} forms are like ordinary variables,
and may be used for other purposes.  However, unlike other variables,
they once again assume their special predefined values if they are
cleared @xref{Status of Variables}.
@end defvr
nan
-*- texinfo -*-
@defvr {Built-in Variable} NaN
@defvrx {Built-in Variable} nan
Not a number.  This is the result of an operation like
@iftex
@tex
$0/0$, or $\infty - \infty$,
@end tex
@end iftex
@ifinfo
0/0, or @samp{Inf - Inf},
@end ifinfo
or any operation with a NaN.

Note that NaN always compares not equal to NaN.  This behavior is
specified by the IEEE standard for floating point arithmetic.  To
find NaN values, you must use the @code{isnan} function.
@end defvr
pi
-*- texinfo -*-
@defvr {Built-in Variable} pi
The ratio of the circumference of a circle to its diameter.
Internally, @code{pi} is computed as @samp{4.0 * atan (1.0)}.
@end defvr
realmax
-*- texinfo -*-
@defvr {Built-in Variable} realmax
The largest floating point number that is representable.  The actual
value is system-dependent.  On machines that support 64-bit IEEE
floating point arithmetic, @code{realmax} is approximately
@ifinfo
 1.7977e+308
@end ifinfo
@iftex
@tex
 $1.7977\times10^{308}$.
@end tex
@end iftex
@end defvr
realmin
-*- texinfo -*-
@defvr {Built-in Variable} realmin
The smallest normalized floating point number that is representable.
The actual value is system-dependent.  On machines that support
64-bit IEEE floating point arithmetic, @code{realmin} is approximately
@ifinfo
 2.2251e-308
@end ifinfo
@iftex
@tex
 $2.2251\times10^{-308}$.
@end tex
@end iftex
@end defvr
true
-*- texinfo -*-
@defvr {Built-in Variable} true
Logical true value.
@end defvr
dbstop
-*- texinfo -*-
@deftypefn {Loadable Function} {rline =} dbstop (func, line)
Set a breakpoint in a function
@table @code
@item func
String representing the function name.  When already in debug
mode this should be left out and only the line should be given.
@item line
Line you would like the breakpoint to be set on
@end table

The rline returned is the real line that the breakpoint was set at.

@end deftypefn
@seealso{dbclear, dbstatus, dbnext}
dbclear
-*- texinfo -*-
@deftypefn {Loadable Function} {} dbclear (func, line)
Delete a breakpoint in a function
@table @code
@item func
String representing the function name.  When already in debug
mode this should be left out and only the line should be given.
@item line
Line where you would like to remove the the breakpoint
@end table
No checking is done to make sure that the line you requested is really
a breakpoint.   If you get the wrong line nothing will happen.
@end deftypefn
@seealso{dbstop, dbstatus, dbwhere}
dbstatus
-*- texinfo -*-
@deftypefn {Loadable Function} {lst =} dbstatus ([func])
Return a vector containing the lines on which a function has 
breakpoints set.
@table @code
@item func
String representing the function name.  When already in debug
mode this should be left out.
@end table
@end deftypefn
@seealso{dbclear, dbwhere}
dbwhere
-*- texinfo -*-
@deftypefn {Loadable Function} {} dbwhere ()
Show where we are in the code
@end deftypefn
@seealso{dbclear, dbstatus, dbstop}
dbtype
-*- texinfo -*-
@deftypefn {Loadable Function} {} dbtype ()
List script file with line numbers.
@end deftypefn
@seealso{dbclear, dbstatus, dbstop}
rehash
-*- texinfo -*-
@deftypefn {Built-in Function} {} rehash ()
Reinitialize Octave's @code{LOADPATH} directory cache.
@end deftypefn
EDITOR
-*- texinfo -*-
@defvr {Built-in Variable} EDITOR
A string naming the editor to use with the @code{edit_history} command.
If the environment variable @code{EDITOR} is set when Octave starts, its
value is used as the default.  Otherwise, @code{EDITOR} is set to
@code{"emacs"}.
@end defvr
FFTW_WISDOM_PROGRAM
-*- texinfo -*-
@defvr {Built-in Variable} FFTW_WISDOM_PROGRAM
A string naming the FFTW wisdom program to use to create wisdom data
to accelerate Fourier transforms. If the environment variable
@code{OCTAVE_WISDOM_PROGRAM} is set when Octave starts, its value is used
as the default. Otherwise, @code{WISDOM_PROGRAM} is set to
@code{"fftw-wisdom"}.
@end defvr
EXEC_PATH
-*- texinfo -*-
@defvr {Built-in Variable} EXEC_PATH
The variable @code{EXEC_PATH} is a colon separated list of directories
to search when executing external programs.  Its initial value is taken from
the environment variable @code{OCTAVE_EXEC_PATH} (if it exists) or
@code{PATH}, but that value can be overridden by the command line
argument @code{--exec-path PATH}, or by setting the value of
@code{EXEC_PATH} in a startup script.  If the value of @code{EXEC_PATH}
begins (ends) with a colon, the directories

@example
@group
@var{octave-home}/libexec/octave/site/exec/@var{arch}
@var{octave-home}/libexec/octave/@var{version}/exec/@var{arch}
@end group
@end example

@noindent
are prepended (appended) to @code{EXEC_PATH}, where @var{octave-home}
is the top-level directory where all of Octave is installed
(the default value is @file{@value{OCTAVEHOME}}).  If you don't specify
a value for @code{EXEC_PATH} explicitly, these special directories are
prepended to your shell path.
@end defvr
DEFAULT_EXEC_PATH
-*- texinfo -*-
@defvr {Built-in Variable} DEFAULT_EXEC_PATH
A colon separated list of directories in which to search when executing
external programs.  The value of this variable is automatically
substituted for leading, trailing, or doubled colons that appear in the
built-in variable @code{EXEC_PATH}.
@end defvr
LOADPATH
-*- texinfo -*-
@defvr {Built-in Variable} LOADPATH
A colon separated list of directories in which to search for function
files.  @xref{Functions and Scripts}.  The value of @code{LOADPATH}
overrides the environment variable @code{OCTAVE_PATH}.  @xref{Installation}.

@code{LOADPATH} is now handled in the same way as @TeX{} handles
@code{TEXINPUTS}.  Leading, trailing, or doubled colons that appear in
@code{LOADPATH} are replaced by the value of @code{DEFAULT_LOADPATH}.
The default value of @code{LOADPATH} is @code{":"}, which tells Octave
to search in the directories specified by @code{DEFAULT_LOADPATH}.

In addition, if any path element ends in @samp{//}, that directory and
all subdirectories it contains are searched recursively for function
files.  This can result in a slight delay as Octave caches the lists of
files found in the @code{LOADPATH} the first time Octave searches for a
function.  After that, searching is usually much faster because Octave
normally only needs to search its internal cache for files.

To improve performance of recursive directory searching, it is best for
each directory that is to be searched recursively to contain
@emph{either} additional subdirectories @emph{or} function files, but
not a mixture of both.

@xref{Organization of Functions}, for a description of the function file
directories that are distributed with Octave.
@end defvr
DEFAULT_LOADPATH
-*- texinfo -*-
@defvr {Built-in Variable} DEFAULT_LOADPATH
A colon separated list of directories in which to search for function
files.  The value of this variable is automatically substituted for
leading, trailing, or doubled colons that appear in the built-in
variable @code{LOADPATH}.
@end defvr
IMAGEPATH
-*- texinfo -*-
@defvr {Built-in Variable} IMAGEPATH
A colon separated list of directories in which to search for image
files.
@end defvr
OCTAVE_HOME
-*- texinfo -*-
@defvr {Built-in Variable} OCTAVE_HOME
The name of the top-level Octave installation directory.
@end defvr
OCTAVE_VERSION
-*- texinfo -*-
@defvr {Built-in Variable} OCTAVE_VERSION
The version number of Octave, as a string.
@end defvr
det
-*- texinfo -*-
@deftypefn {Loadable Function} {[@var{d}, @var{rcond}] = } det (@var{a})
Compute the determinant of @var{a} using @sc{Lapack}.  Return an estimate
of the reciprocal condition number if requested.
@end deftypefn
cd
-*- texinfo -*-
@deffn {Command} cd dir
@deffnx {Command} chdir dir
Change the current working directory to @var{dir}.  If @var{dir} is
omitted, the current directory is changed to the users home
directory.  For example,

@example
cd ~/octave
@end example

@noindent
Changes the current working directory to @file{~/octave}.  If the
directory does not exist, an error message is printed and the working
directory is not changed.
@end deffn
ls
-*- texinfo -*-
@deffn {Command} ls options
List directory contents.  For example,

@example
ls -l
     @print{} total 12
     @print{} -rw-r--r--   1 jwe  users  4488 Aug 19 04:02 foo.m
     @print{} -rw-r--r--   1 jwe  users  1315 Aug 17 23:14 bar.m
@end example

The @code{dir} and @code{ls} commands are implemented by calling your
system's directory listing command, so the available options may vary
from system to system.
@end deffn
pwd
-*- texinfo -*-
@deftypefn {Built-in Function} {} pwd ()
Return the current working directory.
@end deftypefn
readdir
-*- texinfo -*-
@deftypefn {Built-in Function} {[@var{files}, @var{err}, @var{msg}] =} readdir (@var{dir})
Return names of the files in the directory @var{dir} as a cell array of
strings.  If an error occurs, return an empty cell array in @var{files}.

If successful, @var{err} is 0 and @var{msg} is an empty string.
Otherwise, @var{err} is nonzero and @var{msg} contains a
system-dependent error message.
@end deftypefn
mkdir
-*- texinfo -*-
@deftypefn {Built-in Function} {[@var{err}, @var{msg}] =} mkdir (@var{dir})\nCreate a directory named @var{dir}.

If successful, @var{err} is 0 and @var{msg} is an empty string.
Otherwise, @var{err} is nonzero and @var{msg} contains a
system-dependent error message.
@end deftypefn
rmdir
-*- texinfo -*-
@deftypefn {Built-in Function} {[@var{err}, @var{msg}] =} rmdir (@var{dir})
Remove the directory named @var{dir}.

If successful, @var{err} is 0 and @var{msg} is an empty string.
Otherwise, @var{err} is nonzero and @var{msg} contains a
system-dependent error message.
@end deftypefn
link
-*- texinfo -*-
@deftypefn {Built-in Function} {[@var{err}, @var{msg}] =} link (@var{old}, @var{new})
Create a new link (also known as a hard link) to an existing file.

If successful, @var{err} is 0 and @var{msg} is an empty string.
Otherwise, @var{err} is nonzero and @var{msg} contains a
system-dependent error message.
@end deftypefn
symlink
-*- texinfo -*-
@deftypefn {Built-in Function} {[@var{err}, @var{msg}] =} symlink (@var{old}, @var{new})
Create a symbolic link @var{new} which contains the string @var{old}.

If successful, @var{err} is 0 and @var{msg} is an empty string.
Otherwise, @var{err} is nonzero and @var{msg} contains a
system-dependent error message.
@end deftypefn
readlink
-*- texinfo -*-
@deftypefn {Built-in Function} {[@var{result}, @var{err}, @var{msg}] =} readlink (@var{symlink})
Read the value of the symbolic link @var{symlink}.

If successful, @var{result} contains the contents of the symbolic link
@var{symlink}, @var{err} is 0 and @var{msg} is an empty string.
Otherwise, @var{err} is nonzero and @var{msg} contains a
system-dependent error message.
@end deftypefn
rename
-*- texinfo -*-
@deftypefn {Built-in Function} {[@var{err}, @var{msg}] =} rename (@var{old}, @var{new})
Change the name of file @var{old} to @var{new}.

If successful, @var{err} is 0 and @var{msg} is an empty string.
Otherwise, @var{err} is nonzero and @var{msg} contains a
system-dependent error message.
@end deftypefn
glob
-*- texinfo -*-
@deftypefn {Built-in Function} {} glob (@var{pattern})
Given an array of strings in @var{pattern}, return a cell array of file
names that match any of them, or an empty cell array if no patterns match.
Tilde expansion is performed on each of the patterns before looking for
matching file names.  For example,

@example
@group
glob ("/vm*")
     @result{} "/vmlinuz"
@end group
@end example
@end deftypefn
fnmatch
-*- texinfo -*-
@deftypefn {Built-in Function} {} fnmatch (@var{pattern}, @var{string})
Return 1 or zero for each element of @var{string} that matches any of
the elements of the string array @var{pattern}, using the rules of
filename pattern matching.  For example,

@example
@group
fnmatch ("a*b", ["ab"; "axyzb"; "xyzab"])
     @result{} [ 1; 1; 0 ]
@end group
@end example
@end deftypefn
filesep
-*- texinfo -*-
@defvr {Built-in Variable} filesep
The character used to separate directory names.  The value
of this variable is system dependent.
@end defvr
warn_reload_forces_clear
-*- texinfo -*-
@defvr {Built-in Variable} warn_reload_forces_clear
If several functions have been loaded from the same file, Octave must
clear all the functions before any one of them can be reloaded.  If
@code{warn_reload_forces_clear}, Octave will warn you when this happens,
and print a list of the additional functions that it is forced to clear.
@end defvr
eig
-*- texinfo -*-
@deftypefn {Loadable Function} {@var{lambda} =} eig (@var{a})
@deftypefnx {Loadable Function} {[@var{v}, @var{lambda}] =} eig (@var{a})
The eigenvalues (and eigenvectors) of a matrix are computed in a several
step process which begins with a Hessenberg decomposition, followed by a
Schur decomposition, from which the eigenvalues are apparent.  The
eigenvectors, when desired, are computed by further manipulations of the
Schur decomposition.
@end deftypefn
error
-*- texinfo -*-
@deftypefn {Built-in Function} {} error (@var{template}, @dots{})
The @code{error} function formats the optional arguments under the
control of the template string @var{template} using the same rules as
the @code{printf} family of functions (@pxref{Formatted Output}).
The resulting message is prefixed by the string @samp{error: } and
printed on the @code{stderr} stream.

Calling @code{error} also sets Octave's internal error state such that
control will return to the top level without evaluating any more
commands.  This is useful for aborting from functions or scripts.

If the error message does not end with a new line character, Octave will
print a traceback of all the function calls leading to the error.  For
example, given the following function definitions:

@example
@group
function f () g () end
function g () h () end
function h () nargin == 1 || error ("nargin != 1"); end
@end group
@end example

@noindent
calling the function @code{f} will result in a list of messages that
can help you to quickly locate the exact location of the error:

@example
@group
f ()
error: nargin != 1
error: evaluating index expression near line 1, column 30
error: evaluating binary operator `||' near line 1, column 27
error: called from `h'
error: called from `g'
error: called from `f'
@end group
@end example

If the error message ends in a new line character, Octave will print the
message but will not display any traceback messages as it returns
control to the top level.  For example, modifying the error message
in the previous example to end in a new line causes Octave to only print
a single message:

@example
@group
function h () nargin == 1 || error ("nargin != 1\n"); end
f ()
error: nargin != 1
@end group
@end example
@end deftypefn
warning
-*- texinfo -*-
@deftypefn {Built-in Function} {} warning (@var{msg})
Print a warning message @var{msg} prefixed by the string @samp{warning: }.  
After printing the warning message, Octave will continue to execute
commands.  You should use this function when you want to notify the user
of an unusual condition, but only when it makes sense for your program
to go on.
@end deftypefn
lasterr
-*- texinfo -*-
@deftypefn {Built-in Function} {} lasterr ()
@deftypefnx {Built-in Function} {} lasterr (@var{msg})
Without any arguments, return the last error message.  With one
argument, set the last warning message to @var{msg}.
@end deftypefn
lastwarn
-*- texinfo -*-
@deftypefn {Built-in Function} {} lastwarn ()
@deftypefnx {Built-in Function} {} lastwarn (@var{msg})
Without any arguments, return the last warning message.  With one
argument, set the last error message to @var{msg}.
@end deftypefn
usage
-*- texinfo -*-
@deftypefn {Built-in Function} {} usage (@var{msg})
Print the message @var{msg}, prefixed by the string @samp{usage: }, and
set Octave's internal error state such that control will return to the
top level without evaluating any more commands.  This is useful for
aborting from functions.

After @code{usage} is evaluated, Octave will print a traceback of all
the function calls leading to the usage message.

You should use this function for reporting problems errors that result
from an improper call to a function, such as calling a function with an
incorrect number of arguments, or with arguments of the wrong type.  For
example, most functions distributed with Octave begin with code like
this

@example
@group
if (nargin != 2)
  usage ("foo (a, b)");
endif
@end group
@end example

@noindent
to check for the proper number of arguments.
@end deftypefn
beep_on_error
-*- texinfo -*-
@defvr {Built-in Variable} beep_on_error
If the value of @code{beep_on_error} is nonzero, Octave will try
to ring your terminal's bell before printing an error message.  The
default value is 0.
@end defvr
debug_on_error
-*- texinfo -*-
@defvr {Built-in Variable} debug_on_error
If the value of @code{debug_on_error} is nonzero, Octave will try
to enter the debugger when an error is encountered.  This will also
inhibit printing of the normal traceback message (you will only see
the top-level error message).  The default value is 0.
@end defvr
debug_on_warning
-*- texinfo -*-
@defvr {Built-in Variable} debug_on_warning
If the value of @code{debug_on_warning} is nonzero, Octave will try
to enter the debugger when a warning is encountered.  The default
value is 0.
@end defvr
expm
-*- texinfo -*-
@deftypefn {Loadable Function} {} expm (@var{a})
Return the exponential of a matrix, defined as the infinite Taylor
series
@iftex
@tex
$$
 \exp (A) = I + A + {A^2 \over 2!} + {A^3 \over 3!} + \cdots
$$
@end tex
@end iftex
@ifinfo

@example
expm(a) = I + a + a^2/2! + a^3/3! + ...
@end example

@end ifinfo
The Taylor series is @emph{not} the way to compute the matrix
exponential; see Moler and Van Loan, @cite{Nineteen Dubious Ways to
Compute the Exponential of a Matrix}, SIAM Review, 1978.  This routine
uses Ward's diagonal
@iftex
@tex
Pad\'e
@end tex
@end iftex
@ifinfo
Pade'
@end ifinfo
approximation method with three step preconditioning (SIAM Journal on
Numerical Analysis, 1977).  Diagonal
@iftex
@tex
Pad\'e
@end tex
@end iftex
@ifinfo
Pade'
@end ifinfo
 approximations are rational polynomials of matrices
@iftex
@tex
$D_q(a)^{-1}N_q(a)$
@end tex
@end iftex
@ifinfo

@example
     -1
D (a)   N (a)
@end example

@end ifinfo
 whose Taylor series matches the first
@iftex
@tex
$2 q + 1 $
@end tex
@end iftex
@ifinfo
@code{2q+1}
@end ifinfo
terms of the Taylor series above; direct evaluation of the Taylor series
(with the same preconditioning steps) may be desirable in lieu of the
@iftex
@tex
Pad\'e
@end tex
@end iftex
@ifinfo
Pade'
@end ifinfo
approximation when
@iftex
@tex
$D_q(a)$
@end tex
@end iftex
@ifinfo
@code{Dq(a)}
@end ifinfo
is ill-conditioned.
@end deftypefn
fft
-*- texinfo -*-
@deftypefn {Loadable Function} {} fft (@var{a}, @var{n}, @var{dim})
Compute the FFT of @var{a} using subroutines from
@sc{Fftw}. The FFT is calculated along the first non-singleton dimension of the
array. Thus if @var{a} is a matrix, @code{fft (@var{a})} computes the
FFT for each column of @var{a}.

If called with two arguments, @var{n} is expected to be an integer
specifying the number of elements of @var{a} to use, or an empty
matrix to specify that its value should be ignored. If @var{n} is
larger than the dimension along which the FFT is calculated, then
@var{a} is resized and padded with zeros. Otherwise, if@var{n} is
smaller than the dimension along which the FFT is calculated, then
@var{a} is truncated.

If called with three agruments, @var{dim} is an integer specifying the
dimension of the matrix along which the FFT is performed
@end deftypefn
@seealso {ifft, fft2, fftn, fftw_wisdom}
ifft
-*- texinfo -*-
@deftypefn {Loadable Function} {} ifft (@var{a}, @var{n}, @var{dim})
Compute the inverse FFT of @var{a} using subroutines from
@sc{Fftw}. The inverse FFT is calculated along the first non-singleton dimension
of the array. Thus if @var{a} is a matrix, @code{fft (@var{a})} computes
the inverse FFT for each column of @var{a}.

If called with two arguments, @var{n} is expected to be an integer
specifying the number of elements of @var{a} to use, or an empty
matrix to specify that its value should be ignored. If @var{n} is
larger than the dimension along which the inverse FFT is calculated, then
@var{a} is resized and padded with zeros. Otherwise, if@var{n} is
smaller than the dimension along which the inverse FFT is calculated,
then @var{a} is truncated.

If called with three agruments, @var{dim} is an integer specifying the
dimension of the matrix along which the inverse FFT is performed
@end deftypefn
@seealso {fft, ifft2, ifftn, fftw_wisdom}
fft2
-*- texinfo -*-
@deftypefn {Loadable Function} {} fft2 (@var{a}, @var{n}, @var{m})
Compute the two dimensional FFT of @var{a} using subroutines from
@sc{Fftw}. The optional arguments @var{n} and @var{m} may be used specify the
number of rows and columns of @var{a} to use.  If either of these is
larger than the size of @var{a}, @var{a} is resized and padded with
zeros.

If @var{a} is a multi-dimensional matrix, each two-dimensional sub-matrix
of @var{a} is treated seperately
@end deftypefn
@seealso {ifft2, fft, fftn fftw_wisdom}
ifft2
-*- texinfo -*-
@deftypefn {Loadable Function} {} fft2 (@var{a}, @var{n}, @var{m})
Compute the inverse two dimensional FFT of @var{a} using subroutines from
@sc{Fftw}. The optional arguments @var{n} and @var{m} may be used specify the
number of rows and columns of @var{a} to use.  If either of these is
larger than the size of @var{a}, @var{a} is resized and padded with
zeros.

If @var{a} is a multi-dimensional matrix, each two-dimensional sub-matrix
of @var{a} is treated seperately
@end deftypefn
@seealso {fft2, ifft, ifftn, fftw_wisdom}
fftn
-*- texinfo -*-
@deftypefn {Loadable Function} {} fftn (@var{a}, @var{size})
Compute the N dimensional FFT of @var{a} using subroutines from
@sc{Fftw}. The optional vector argument @var{size} may be used specify the
dimensions of the array to be used. If an element of @var{size} is
smaller than the corresponding dimension, then the dimension is
truncated prior to performing the FFT. Otherwise if an element
of @var{size} is larger than the corresponding dimension @var{a}
is resized and padded with zeros.
@end deftypefn
@seealso {ifftn, fft, fft2, fftw_wisdom}
ifftn
-*- texinfo -*-
@deftypefn {Loadable Function} {} ifftn (@var{a}, @var{size})
Compute the invesre N dimensional FFT of @var{a} using subroutines from
@sc{Fftw}. The optional vector argument @var{size} may be used specify the
dimensions of the array to be used. If an element of @var{size} is
smaller than the corresponding dimension, then the dimension is
truncated prior to performing the inverse FFT. Otherwise if an element
of @var{size} is larger than the corresponding dimension @var{a}
is resized and padded with zeros.
@end deftypefn
@seealso {fftn, ifft, ifft2, fftw_wisdom}
fftw_wisdom
-*- texinfo -*-
@deftypefn {Loadable Function} {} fftw_wisdom (@var{file}, @var{ow})
@deftypefnx {Loadable Function} {} fftw_wisdom (@var{n})

This function is used to manipulate the FFTW wisdom data. It can
be used to load previously stored wisdom from a file, create wisdom
needed by Octave and to save the current wisdom to a file. Wisdom
data can be used to significantly accelerate the calculation of the FFTs,
but is only profitable if the same FFT is called many times due to the
overhead in calculating the wisdom data.

Called with a single string argument, @code{fftw_wisdom (@var{file})}
will load the wisdom data found in @var{file}. If @var{file} does
not exist, then the current wisdom used by FFTW is saved to this
file. If the flag @var{ow} is non-zero, then even if @var{file}
exists, it will be overwritten.

It is assumed that each row of @var{n} represents the size of a FFT for
which it is desired to pre-calculate the wisdom needed to accelerate it.
Any value of the matrix that is less than 1, is assumed to indicate an
absent dimension. That is

@example
fftw_wisdom ([102, 0, 0; 103, 103, 0; 102, 103, 105]);
a = fft (rand (1,102));
b = fft (rand (103,103));
c = fftn (rand ([102, 103, 105]));
@end example

calculates the wisdom necessary to accelerate the 103, 102x102 and
the 102x103x105 FFTs. Note that calculated wisdom will be lost when
when restarting Octave. However, if it is saved as discussed above, it
can be reloaded. Also, any system-wide wisdom file that has been found
will also be used. Saved wisdom files should not be used on different
platforms since they will not be efficient and the point of calculating
the wisdom is lost.

Note that the program @code{fftw-wisdom} supplied with FFTW can equally
be used to create a file containing wisdom that can be imported into
Octave.
@end deftypefn
@seealso {fft, ifft, fft2, ifft2, fftn, ifftn}
isstream
-*- texinfo -*-
@deftypefn {Built-in Function} {} isstream (@var{x})
Return true if @var{x} is a stream object.  Otherwise, return false.
@end deftypefn
fclose
-*- texinfo -*-
@deftypefn {Built-in Function} {} fclose (@var{fid})
Closes the specified file.  If successful, @code{fclose} returns 0,
otherwise, it returns -1.
@end deftypefn
fflush
-*- texinfo -*-
@deftypefn {Built-in Function} {} fflush (@var{fid})
Flush output to @var{fid}.  This is useful for ensuring that all
pending output makes it to the screen before some other event occurs.
For example, it is always a good idea to flush the standard output
stream before calling @code{input}.
@end deftypefn
fgetl
-*- texinfo -*-
@deftypefn {Built-in Function} {} fgetl (@var{fid}, @var{len})
Read characters from a file, stopping after a newline, or EOF,
or @var{len} characters have been read.  The characters read, excluding
the possible trailing newline, are returned as a string.

If @var{len} is omitted, @code{fgetl} reads until the next newline
character.

If there are no more characters to read, @code{fgetl} returns @minus{}1.
@end deftypefn
fgets
-*- texinfo -*-
@deftypefn {Built-in Function} {} fgets (@var{fid}, @var{len})
Read characters from a file, stopping after a newline, or EOF,
or @var{len} characters have been read.  The characters read, including
the possible trailing newline, are returned as a string.

If @var{len} is omitted, @code{fgets} reads until the next newline
character.

If there are no more characters to read, @code{fgets} returns @minus{}1.
@end deftypefn
fopen
-*- texinfo -*-
@deftypefn {Built-in Function} {[@var{fid}, @var{msg}] =} fopen (@var{name}, @var{mode}, @var{arch})
@deftypefnx {Built-in Function} {@var{fid_list} =} fopen ("all")
@deftypefnx {Built-in Function} {@var{file} =} fopen (@var{fid})
The first form of the @code{fopen} function opens the named file with
the specified mode (read-write, read-only, etc.) and architecture
interpretation (IEEE big endian, IEEE little endian, etc.), and returns
an integer value that may be used to refer to the file later.  If an
error occurs, @var{fid} is set to @minus{}1 and @var{msg} contains the
corresponding system error message.  The @var{mode} is a one or two
character string that specifies whether the file is to be opened for
reading, writing, or both.

The second form of the @code{fopen} function returns a vector of file ids
corresponding to all the currently open files, excluding the
@code{stdin}, @code{stdout}, and @code{stderr} streams.

The third form of the @code{fopen} function returns the name of a
currently open file given its file id.

For example,

@example
myfile = fopen ("splat.dat", "r", "ieee-le");
@end example

@noindent
opens the file @file{splat.dat} for reading.  If necessary, binary
numeric values will be read assuming they are stored in IEEE format with
the least significant bit first, and then converted to the native
representation.

Opening a file that is already open simply opens it again and returns a
separate file id.  It is not an error to open a file several times,
though writing to the same file through several different file ids may
produce unexpected results.

The possible values @samp{mode} may have are

@table @asis
@item @samp{r}
Open a file for reading.

@item @samp{w}
Open a file for writing.  The previous contents are discared.

@item @samp{a}
Open or create a file for writing at the end of the file.

@item @samp{r+}
Open an existing file for reading and writing.

@item @samp{w+}
Open a file for reading or writing.  The previous contents are
discarded.

@item @samp{a+}
Open or create a file for reading or writing at the end of the
file.
@end table

The parameter @var{arch} is a string specifying the default data format
for the file.  Valid values for @var{arch} are:

@table @asis
@samp{native}
The format of the current machine (this is the default).

@samp{ieee-be}
IEEE big endian format.

@samp{ieee-le}
IEEE little endian format.

@samp{vaxd}
VAX D floating format.

@samp{vaxg}
VAX G floating format.

@samp{cray}
Cray floating format.
@end table

@noindent
however, conversions are currently only supported for @samp{native}
@samp{ieee-be}, and @samp{ieee-le} formats.
@end deftypefn
freport
-*- texinfo -*-
@deftypefn {Built-in Function} {} freport ()
Print a list of which files have been opened, and whether they are open
for reading, writing, or both.  For example,

@example
@group
freport ()

     @print{}  number  mode  name
     @print{} 
     @print{}       0     r  stdin
     @print{}       1     w  stdout
     @print{}       2     w  stderr
     @print{}       3     r  myfile
@end group
@end example
@end deftypefn
frewind
-*- texinfo -*-
@deftypefn {Built-in Function} {} frewind (@var{fid})
Move the file pointer to the beginning of the file @var{fid}, returning
0 for success, and -1 if an error was encountered.  It is equivalent to
@code{fseek (@var{fid}, 0, SEEK_SET)}.
@end deftypefn
fseek
-*- texinfo -*-
@deftypefn {Built-in Function} {} fseek (@var{fid}, @var{offset}, @var{origin})
Set the file pointer to any location within the file @var{fid}.  The
pointer is positioned @var{offset} characters from the @var{origin},
which may be one of the predefined variables @code{SEEK_CUR} (current
position), @code{SEEK_SET} (beginning), or @code{SEEK_END} (end of
file). If @var{origin} is omitted, @code{SEEK_SET} is assumed.  The
offset must be zero, or a value returned by @code{ftell} (in which case
@var{origin} must be @code{SEEK_SET}.
@end deftypefn
ftell
-*- texinfo -*-
@deftypefn {Built-in Function} {} ftell (@var{fid})
Return the position of the file pointer as the number of characters
from the beginning of the file @var{fid}.
@end deftypefn
fprintf
-*- texinfo -*-
@deftypefn {Built-in Function} {} fprintf (@var{fid}, @var{template}, @dots{})
This function is just like @code{printf}, except that the output is
written to the stream @var{fid} instead of @code{stdout}.
@end deftypefn
printf
-*- texinfo -*-
@deftypefn {Built-in Function} {} printf (@var{fid}, @var{template}, @dots{})
Print optional arguments under the control of the template string
@var{template} to the stream @code{stdout}.
@end deftypefn
@seealso{fprintf and sprintf}
fputs
-*- texinfo -*-
@deftypefn {Built-in Function} {} fputs (@var{fid}, @var{string})
Write a string to a file with no formatting.
@end deftypefn
puts
-*- texinfo -*-
@deftypefn {Built-in Function} {} puts (@var{string})
Write a string to the standard output with no formatting.
@end deftypefn
sprintf
-*- texinfo -*-
@deftypefn {Built-in Function} {} sprintf (@var{template}, @dots{})
This is like @code{printf}, except that the output is returned as a
string.  Unlike the C library function, which requires you to provide a
suitably sized string as an argument, Octave's @code{sprintf} function
returns the string, automatically sized to hold all of the items
converted.
@end deftypefn
fscanf
-*- texinfo -*-
@deftypefn {Built-in Function} {[@var{val}, @var{count}] =} fscanf (@var{fid}, @var{template}, @var{size})
@deftypefnx {Built-in Function} {[@var{v1}, @var{v2}, @dots{}, @var{count}] = } fscanf (@var{fid}, @var{template}, "C")
In the first form, read from @var{fid} according to @var{template},
returning the result in the matrix @var{val}.

The optional argument @var{size} specifies the amount of data to read
and may be one of

@table @code
@item Inf
Read as much as possible, returning a column vector.

@item @var{nr}
Read up to @var{nr} elements, returning a column vector.

@item [@var{nr}, Inf]
Read as much as possible, returning a matrix with @var{nr} rows.  If the
number of elements read is not an exact multiple of @var{nr}, the last
column is padded with zeros.

@item [@var{nr}, @var{nc}]
Read up to @code{@var{nr} * @var{nc}} elements, returning a matrix with
@var{nr} rows.  If the number of elements read is not an exact multiple
of @var{nr}, the last column is padded with zeros.
@end table

@noindent
If @var{size} is omitted, a value of @code{Inf} is assumed.

A string is returned if @var{template} specifies only character
conversions.

The number of items successfully read is returned in @var{count}.

In the second form, read from @var{fid} according to @var{template},
with each conversion specifier in @var{template} corresponding to a
single scalar return value.  This form is more `C-like', and also
compatible with previous versions of Octave.  The number of successful
conversions is returned in @var{count}
@end deftypefn
sscanf
-*- texinfo -*-
@deftypefn {Built-in Function} {[@var{val}, @var{count}] =} sscanf (@var{string}, @var{template}, @var{size})
@deftypefnx {Built-in Function} {[@var{v1}, @var{v2}, @dots{}, @var{count}] = } sscanf (@var{string}, @var{template}, "C")
This is like @code{fscanf}, except that the characters are taken from the
string @var{string} instead of from a stream.  Reaching the end of the
string is treated as an end-of-file condition.
@end deftypefn
scanf
-*- texinfo -*-
@deftypefn {Built-in Function} {[@var{val}, @var{count}] =} scanf (@var{template}, @var{size})
@deftypefnx {Built-in Function} {[@var{v1}, @var{v2}, @dots{}, @var{count}]] = } scanf (@var{template}, "C")
This is equivalent to calling @code{fscanf} with @var{fid} = @code{stdin}.

It is currently not useful to call @code{scanf} in interactive
programs.
@end deftypefn
fread
-*- texinfo -*-
@deftypefn {Built-in Function} {[@var{val}, @var{count}] =} fread (@var{fid}, @var{size}, @var{precision}, @var{skip}, @var{arch})
Read binary data of type @var{precision} from the specified file ID
@var{fid}.

The optional argument @var{size} specifies the amount of data to read
and may be one of

@table @code
@item Inf
Read as much as possible, returning a column vector.

@item @var{nr}
Read up to @var{nr} elements, returning a column vector.

@item [@var{nr}, Inf]
Read as much as possible, returning a matrix with @var{nr} rows.  If the
number of elements read is not an exact multiple of @var{nr}, the last
column is padded with zeros.

@item [@var{nr}, @var{nc}]
Read up to @code{@var{nr} * @var{nc}} elements, returning a matrix with
@var{nr} rows.  If the number of elements read is not an exact multiple
of @var{nr}, the last column is padded with zeros.
@end table

@noindent
If @var{size} is omitted, a value of @code{Inf} is assumed.

The optional argument @var{precision} is a string specifying the type of
data to read and may be one of

@table @code
@item "char"
@itemx "char*1"
@itemx "integer*1"
@itemx "int8"
Single character.

@item "signed char"
@itemx "schar"
Signed character.

@item "unsigned char"
@itemx "uchar"
@itemx "uint8"
Unsigned character.

@item "short"
Short integer.

@item "unsigned short"
@itemx "ushort"
Unsigned short integer.

@item "int"
Integer.

@item "unsigned int"
@itemx "uint"
Unsigned integer.

@item "long"
Long integer.

@item "unsigned long"
@itemx "ulong"
Unsigned long integer.

@item "float"
@itemx "float32"
@itemx "real*4"
Single precision float.

@item "double"
@itemx "float64"
@itemx "real*8"
Double precision float.

@item "integer*2"
@itemx "int16"
Two byte signed integer.

@item "integer*4"
@itemx "int32"
Four byte signed integer.

@item "uint16"
Two byte unsigned integer.

@item "uint32"
Four byte unsigned integer.
@end table

@noindent
The default precision is @code{"uchar"}.

The optional argument @var{skip} specifies the number of bytes to skip
after each element is read.  If it is not specified, a value of 0 is
assumed.

The optional argument @var{arch} is a string specifying the data format
for the file.  Valid values are

@table @code
@item "native"
The format of the current machine.

@item "ieee-be"
IEEE big endian.

@item "ieee-le"
IEEE little endian.

@item "vaxd"
VAX D floating format.

@item "vaxg"
VAX G floating format.

@item "cray"
Cray floating format.
@end table

@noindent
Conversions are currently only supported for @code{"ieee-be"} and
@code{"ieee-le"} formats.

The data read from the file is returned in @var{val}, and the number of
values read is returned in @code{count}
@end deftypefn
fwrite
-*- texinfo -*-
@deftypefn {Built-in Function} {@var{count} =} fwrite (@var{fid}, @var{data}, @var{precision}, @var{skip}, @var{arch})
Write data in binary form of type @var{precision} to the specified file
ID @var{fid}, returning the number of values successfully written to the
file.

The argument @var{data} is a matrix of values that are to be written to
the file.  The values are extracted in column-major order.

The remaining arguments @var{precision}, @var{skip}, and @var{arch} are
optional, and are interpreted as described for @code{fread}.

The behavior of @code{fwrite} is undefined if the values in @var{data}
are too large to fit in the specified precision.
@end deftypefn
feof
-*- texinfo -*-
@deftypefn {Built-in Function} {} feof (@var{fid})
Return 1 if an end-of-file condition has been encountered for a given
file and 0 otherwise.  Note that it will only return 1 if the end of the
file has already been encountered, not if the next read operation will
result in an end-of-file condition.
@end deftypefn
ferror
-*- texinfo -*-
@deftypefn {Built-in Function} {} ferror (@var{fid})
Return 1 if an error condition has been encountered for a given file
and 0 otherwise.  Note that it will only return 1 if an error has
already been encountered, not if the next operation will result in an
error condition.
@end deftypefn
popen
-*- texinfo -*-
@deftypefn {Built-in Function} {@var{fid} =} popen (@var{command}, @var{mode})
Start a process and create a pipe.  The name of the command to run is
given by @var{command}.  The file identifier corresponding to the input
or output stream of the process is returned in @var{fid}.  The argument
@var{mode} may be

@table @code
@item "r"
The pipe will be connected to the standard output of the process, and
open for reading.

@item "w"
The pipe will be connected to the standard input of the process, and
open for writing.
@end table

For example,

@example
@group
fid = popen ("ls -ltr / | tail -3", "r");
while (isstr (s = fgets (fid)))
  fputs (stdout, s);
endwhile
     @print{} drwxr-xr-x  33 root  root  3072 Feb 15 13:28 etc
     @print{} drwxr-xr-x   3 root  root  1024 Feb 15 13:28 lib
     @print{} drwxrwxrwt  15 root  root  2048 Feb 17 14:53 tmp
@end group
@end example
@end deftypefn
pclose
-*- texinfo -*-
@deftypefn {Built-in Function} {} pclose (@var{fid})
Close a file identifier that was opened by @code{popen}.  You may also
use @code{fclose} for the same purpose.
@end deftypefn
tmpnam
-*- texinfo -*-
@deftypefn {Built-in Function} {} tmpnam (@var{dir}, @var{prefix})
Return a unique temporary file name as a string.

If @var{prefix} is omitted, a value of @code{"oct-"} is used.
If @var{dir} is also omitted, the default directory for temporary files
is used.  If @var{dir} is provided, it must exist, otherwise the default
directory for temporary files is used.  Since the named file is not
opened, by @code{tmpnam}, it is possible (though relatively unlikely)
that it will not be available by the time your program attempts to open it.
@end deftypefn
@seealso{tmpfile, mkstemp, and P_tmpdir}
tmpfile
-*- texinfo -*-
@deftypefn {Built-in Function} {[@var{fid}, @var{msg}] =} tmpfile ()
Return the file ID corresponding to a new temporary file with a unique
name.  The file is opened in binary read/write (@code{"w+b"}) mode.
The file will be deleted automatically when it is closed or when Octave
exits.

If successful, @var{fid} is a valid file ID and @var{msg} is an empty
string.  Otherwise, @var{fid} is -1 and @var{msg} contains a
system-dependent error message.
@end deftypefn
@seealso{tmpnam, mkstemp, and P_tmpdir}
mkstemp
-*- texinfo -*-
@deftypefn {Built-in Function} {[@var{fid}, @var{name}, @var{msg}] =} tmpfile (@var{template}, @var{delete})
Return the file ID corresponding to a new temporary file with a unique
name created from @var{template}.  The last six characters of @var{template}
must be @code{XXXXXX} and tehse are replaced with a string that makes the
filename unique.  The file is then created with mode read/write and
permissions that are system dependent (on GNU/Linux systems, the permissions
will be 0600 for versions of glibc 2.0.7 and later).  The file is opened
with the @code{O_EXCL} flag.

If the optional argument @var{delete} is supplied and is true,
the file will be deleted automatically when Octave exits, or when
the function @code{purge_tmp_files} is called.

If successful, @var{fid} is a valid file ID, @var{name} is the name of
the file, and and @var{msg} is an empty string.  Otherwise, @var{fid}
is -1, @var{name} is empty, and @var{msg} contains a system-dependent
error message.
@end deftypefn
@seealso{tmpfile, tmpnam, and P_tmpdir}
umask
-*- texinfo -*-
@deftypefn {Built-in Function} {} umask (@var{mask})
Set the permission mask for file creation.  The parameter @var{mask}
is an integer, interpreted as an octal number.  If successful,
returns the previous value of the mask (as an integer to be
interpreted as an octal number); otherwise an error message is printed.
@end deftypefn
P_tmpdir
-*- texinfo -*-
@defvr {Built-in Variable} P_tmpdir
The default name of the directory for temporary files on this system.
of this variable is system dependent.
@end defvr
SEEK_SET
-*- texinfo -*-
@defvr {Built-in Variable} SEEK_SET
@defvrx {Built-in Variable} SEEK_CUR
@defvrx {Built-in Variable} SEEK_END
These variables may be used as the optional third argument for the
function @code{fseek}.

@table @code
@item SEEK_SET
Position file relative to the beginning.

@item SEEK_CUR
Position file relative to the current position.

@item SEEK_END
used with fseek to position file relative to the end.
@end table
@end defvr
SEEK_CUR
-*- texinfo -*-
@defvr {Built-in Variable} SEEK_CUR
See SEEK_SET.
@end defvr
SEEK_END
-*- texinfo -*-
@defvr {Built-in Variable} SEEK_END
See SEEK_SET.
@end defvr
stdin
-*- texinfo -*-
@defvr {Built-in Variable} stdin
The standard input stream (file id 0).  When Octave is used
interactively, this is filtered through the command line editing
functions.
@end defvr
stdout
-*- texinfo -*-
@defvr {Built-in Variable} stdout
The standard output stream (file id 1).  Data written to the
standard output is normally filtered through the pager.
@end defvr
stderr
-*- texinfo -*-
@defvr {Built-in Variable} stderr
The standard error stream (file id 2).  Even if paging is turned on,
the standard error is not sent to the pager.  It is useful for error
messages and prompts.
@end defvr
filter
-*- texinfo -*-
@deftypefn {Loadable Function} {y =} filter (@var{b}, @var{a}, @var{x})
@deftypefnx {Loadable Function} {[@var{y}, @var{sf}] =} filter (@var{b}, @var{a}, @var{x}, @var{si})
Return the solution to the following linear, time-invariant difference
equation:
@iftex
@tex
$$
\sum_{k=0}^N a_{k+1} y_{n-k} = \sum_{k=0}^M b_{k+1} x_{n-k}, \qquad
 1 \le n \le P
$$
@end tex
@end iftex
@ifinfo

@smallexample
   N                   M
  SUM a(k+1) y(n-k) = SUM b(k+1) x(n-k)      for 1<=n<=length(x)
  k=0                 k=0
@end smallexample
@end ifinfo

@noindent
where
@ifinfo
 N=length(a)-1 and M=length(b)-1.
@end ifinfo
@iftex
@tex
 $a \in \Re^{N-1}$, $b \in \Re^{M-1}$, and $x \in \Re^P$.
@end tex
@end iftex
An equivalent form of this equation is:
@iftex
@tex
$$
y_n = -\sum_{k=1}^N c_{k+1} y_{n-k} + \sum_{k=0}^M d_{k+1} x_{n-k}, \qquad
 1 \le n \le P
$$
@end tex
@end iftex
@ifinfo

@smallexample
            N                   M
  y(n) = - SUM c(k+1) y(n-k) + SUM d(k+1) x(n-k)  for 1<=n<=length(x)
           k=1                 k=0
@end smallexample
@end ifinfo

@noindent
where
@ifinfo
 c = a/a(1) and d = b/a(1).
@end ifinfo
@iftex
@tex
$c = a/a_1$ and $d = b/a_1$.
@end tex
@end iftex

If the fourth argument @var{si} is provided, it is taken as the
initial state of the system and the final state is returned as
@var{sf}.  The state vector is a column vector whose length is
equal to the length of the longest coefficient vector minus one.
If @var{si} is not supplied, the initial state vector is set to all
zeros.

In terms of the z-transform, y is the result of passing the discrete-
time signal x through a system characterized by the following rational
system function:
@iftex
@tex
$$
H(z) = {\displaystyle\sum_{k=0}^M d_{k+1} z^{-k}
        \over 1 + \displaystyle\sum_{k+1}^N c_{k+1} z^{-k}}
$$
@end tex
@end iftex
@ifinfo

@example
             M
            SUM d(k+1) z^(-k)
            k=0
  H(z) = ----------------------
               N
          1 + SUM c(k+1) z(-k)
              k=1
@end example
@end ifinfo
@end deftypefn
find
-*- texinfo -*-
@deftypefn {Loadable Function} {} find (@var{x})
Return a vector of indices of nonzero elements of a matrix.  To obtain a
single index for each matrix element, Octave pretends that the columns
of a matrix form one long vector (like Fortran arrays are stored).  For
example,

@example
@group
find (eye (2))
     @result{} [ 1; 4 ]
@end group
@end example

If two outputs are requested, @code{find} returns the row and column
indices of nonzero elements of a matrix.  For example,

@example
@group
[i, j] = find (2 * eye (2))
     @result{} i = [ 1; 2 ]
     @result{} j = [ 1; 2 ]
@end group
@end example

If three outputs are requested, @code{find} also returns a vector
containing the nonzero values.  For example,

@example
@group
[i, j, v] = find (3 * eye (2))
     @result{} i = [ 1; 2 ]
     @result{} j = [ 1; 2 ]
     @result{} v = [ 3; 3 ]
@end group
@end example
@end deftypefn
fsolve_options
-*- texinfo -*-
@deftypefn {Loadable Function} {} fsolve_options (@var{opt}, @var{val})
When called with two arguments, this function allows you set options
parameters for the function @code{fsolve}.  Given one argument,
@code{fsolve_options} returns the value of the corresponding option.  If
no arguments are supplied, the names of all the available options and
their current values are displayed.

Options include

@table @code
@item "tolerance"
Nonnegative relative tolerance.
@end table
@end deftypefn
fsolve
-*- texinfo -*-
@deftypefn {Loadable Function} {[@var{x}, @var{info}, @var{msg}] =} fsolve (@var{fcn}, @var{x0})
Given @var{fcn}, the name of a function of the form @code{f (@var{x})}
and an initial starting point @var{x0}, @code{fsolve} solves the set of
equations such that @code{f(@var{x}) == 0}.

If @var{fcn} is a two-element string array, the first element names
the function @math{f} described above, and the second element names
a function of the form @code{j (@var{x})} to compute the Jacobian
matrix with elements
@tex
$$ J = {\partial f_i \over \partial x_j} $$
@end tex
@ifinfo

@example
           df_i
jac(i,j) = ----
           dx_j
@end example
@end ifinfo

You can use the function @code{fsolve_options} to set optional
parameters for @code{fsolve}.
@end deftypefn
gammainc
-*- texinfo -*-
@deftypefn {Mapping Function} {} gammainc (@var{x}, @var{a})
Computes the incomplete gamma function,
@iftex
@tex
$$
 \gamma (x, a) = {\displaystyle\int_0^x e^{-t} t^{a-1} dt \over \Gamma (a)}
$$
@end tex
@end iftex
@ifinfo

@smallexample
                                x
                      1        /
gammainc (x, a) = ---------    | exp (-t) t^(a-1) dt
                  gamma (a)    /
                            t=0
@end smallexample
@end ifinfo

If @var{a} is scalar, then @code{gammainc (@var{x}, @var{a})} is returned
for each element of @var{x} and vice versa.

If neither @var{x} nor @var{a} is scalar, the sizes of @var{x} and
@var{a} must agree, and @var{gammainc} is applied element-by-element.
@end deftypefn
@seealso{gamma and lgamma}
getgrent
-*- texinfo -*-
@deftypefn {Loadable Function} {@var{grp_struct} =} getgrent ()
Return an entry from the group database, opening it if necessary.
Once the end of the data has been reached, @code{getgrent} returns 0.
@end deftypefn
getgrgid
-*- texinfo -*-
@deftypefn {Loadable Function} {@var{grp_struct} =} getgrgid (@var{gid}).
Return the first entry from the group database with the group ID
@var{gid}.  If the group ID does not exist in the database,
@code{getgrgid} returns 0.
@end deftypefn
getgrnam
-*- texinfo -*-
@deftypefn {Loadable Function} {@var{grp_struct} =} getgrnam (@var{name})
Return the first entry from the group database with the group name
@var{name}.  If the group name does not exist in the database,
@code{getgrname} returns 0.
@end deftypefn
setgrent
-*- texinfo -*-
@deftypefn {Loadable Function} {} setgrent ()
Return the internal pointer to the beginning of the group database.
@end deftypefn
endgrent
-*- texinfo -*-
@deftypefn {Loadable Function} {} endgrent ()
Close the group database.
@end deftypefn
getpwent
-*- texinfo -*-
@deftypefn {Loadable Function} {@var{pw_struct} = } getpwent ()
Return a structure containing an entry from the password database,
opening it if necessary. Once the end of the data has been reached,
@code{getpwent} returns 0.
@end deftypefn
getpwuid
-*- texinfo -*-
@deftypefn {Loadable Function} {@var{pw_struct} = } getpwuid (@var{uid}).
Return a structure containing the first entry from the password database
with the user ID @var{uid}.  If the user ID does not exist in the
database, @code{getpwuid} returns 0.
@end deftypefn
getpwnam
-*- texinfo -*-
@deftypefn {Loadable Function} {@var{pw_struct} = } getpwnam (@var{name})
Return a structure containing the first entry from the password database
with the user name @var{name}.  If the user name does not exist in the
database, @code{getpwname} returns 0.
@end deftypefn
setpwent
-*- texinfo -*-
@deftypefn {Loadable Function} {} setpwent ()
Return the internal pointer to the beginning of the password database.
@end deftypefn
endpwent
-*- texinfo -*-
@deftypefn {Loadable Function} {} endpwent ()
Close the password database.
@end deftypefn
getrusage
-*- texinfo -*-
@deftypefn {Loadable Function} {} getrusage ()
Return a structure containing a number of statistics about the current
Octave process.  Not all fields are available on all systems.  If it is
not possible to get CPU time statistics, the CPU time slots are set to
zero.  Other missing data are replaced by NaN.  Here is a list of all
the possible fields that can be present in the structure returned by
@code{getrusage}:

@table @code
@item idrss
Unshared data size.

@item inblock
Number of block input operations.

@item isrss
Unshared stack size.

@item ixrss
Shared memory size.

@item majflt
Number of major page faults.

@item maxrss
Maximum data size.

@item minflt
Number of minor page faults.

@item msgrcv
Number of messages received.

@item msgsnd
Number of messages sent.

@item nivcsw
Number of involuntary context switches.

@item nsignals
Number of signals received.

@item nswap
Number of swaps.

@item nvcsw
Number of voluntary context switches.

@item oublock
Number of block output operations.

@item stime
A structure containing the system CPU time used.  The structure has the
elements @code{sec} (seconds) @code{usec} (microseconds).

@item utime
A structure containing the user CPU time used.  The structure has the
elements @code{sec} (seconds) @code{usec} (microseconds).
@end table
@end deftypefn
givens
-*- texinfo -*-
@deftypefn {Loadable Function} {@var{g} =} givens (@var{x}, @var{y})
@deftypefnx {Loadable Function} {[@var{c}, @var{s}] =} givens (@var{x}, @var{y})
@iftex
@tex
Return a $2\times 2$ orthogonal matrix
$$
 G = \left[\matrix{c & s\cr -s'& c\cr}\right]
$$
such that
$$
 G \left[\matrix{x\cr y}\right] = \left[\matrix{\ast\cr 0}\right]
$$
with $x$ and $y$ scalars.
@end tex
@end iftex
@ifinfo
Return a 2 by 2 orthogonal matrix
@code{@var{g} = [@var{c} @var{s}; -@var{s}' @var{c}]} such that
@code{@var{g} [@var{x}; @var{y}] = [*; 0]} with @var{x} and @var{y} scalars.
@end ifinfo

For example,

@example
@group
givens (1, 1)
     @result{}   0.70711   0.70711
         -0.70711   0.70711
@end group
@end example
@end deftypefn
help
-*- texinfo -*-
@deffn {Command} help
Octave's @code{help} command can be used to print brief usage-style
messages, or to display information directly from an on-line version of
the printed manual, using the GNU Info browser.  If invoked without any
arguments, @code{help} prints a list of all the available operators,
functions, and built-in variables.  If the first argument is @code{-i},
the @code{help} command searches the index of the on-line version of
this manual for the given topics.

For example, the command @kbd{help help} prints a short message
describing the @code{help} command, and @kbd{help -i help} starts the
GNU Info browser at this node in the on-line version of the manual.

Once the GNU Info browser is running, help for using it is available
using the command @kbd{C-h}.
@end deffn
type
-*- texinfo -*-

@deffn {Command} type options name @dots{}
Display the definition of each @var{name} that refers to a function.

Normally also displays if each @var{name} is user-defined or builtin;
the @code{-q} option suppresses this behaviour.

Currently, Octave can only display functions that can be compiled
cleanly, because it uses its internal representation of the function to
recreate the program text.

Comments are not displayed because Octave's parser currently discards
them as it converts the text of a function file to its internal
representation.  This problem may be fixed in a future release.
@end deffn
which
-*- texinfo -*-
@deffn {Command} which name @dots{}
Display the type of each @var{name}.  If @var{name} is defined from a
function file, the full name of the file is also displayed.
@end deffn
INFO_FILE
-*- texinfo -*-
@defvr {Built-in Variable} INFO_FILE
The variable @code{INFO_FILE} names the location of the Octave info file.
The default value is @code{"@var{octave-home}/info/octave.info"}, in
which @var{octave-home} is the directory where all of Octave is installed.
@end defvr
INFO_PROGRAM
-*- texinfo -*-
@defvr {Built-in Variable} INFO_PROGRAM
The variable @code{INFO_PROGRAM} names the info program to run.  Its
default initial value is
@code{"@var{octave-home}/libexec/octave/@var{version}/exec/@var{arch}/info"}
in which @var{octave-home} is the directory where all of Octave is
installed, @var{version} is the Octave version number, and @var{arch}
is the system type (for example, @code{i686-pc-linux-gnu}).  The
default initial value may be overridden by the environment variable
@code{OCTAVE_INFO_PROGRAM}, or the command line argument
@code{--info-program NAME}, or by setting the value of
@code{INFO_PROGRAM} in a startup script
@end defvr
MAKEINFO_PROGRAM
-*- texinfo -*-
@defvr {Built-in Variable} MAKEINFO_PROGRAM
The variable @code{MAKEINFO_PROGRAM} names the makeinfo program that
Octave runs to format help text that contains Texinfo markup commands.
Its default initial value is @code{"makeinfo"}.
@end defvr
suppress_verbose_help_message
-*- texinfo -*-
@defvr {Built-in Variable} suppress_verbose_help_message
If the value of @code{suppress_verbose_help_message} is nonzero, Octave
will not add additional help information to the end of the output from
the @code{help} command and usage messages for built-in commands.
@end defvr
hess
-*- texinfo -*-
@deftypefn {Loadable Function} {@var{h} =} hess (@var{a})
@deftypefnx {Loadable Function} {[@var{p}, @var{h}] =} hess (@var{a})
@cindex Hessenberg decomposition
Compute the Hessenberg decomposition of the matrix @var{a}.

The Hessenberg decomposition is usually used as the first step in an
eigenvalue computation, but has other applications as well (see Golub,
Nash, and Van Loan, IEEE Transactions on Automatic Control, 1979).  The
Hessenberg decomposition is
@iftex
@tex
$$
A = PHP^T
$$
where $P$ is a square unitary matrix ($P^HP = I$), and $H$
is upper Hessenberg ($H_{i,j} = 0, \forall i \ge j+1$).
@end tex
@end iftex
@ifinfo
@code{p * h * p' = a} where @code{p} is a square unitary matrix
(@code{p' * p = I}, using complex-conjugate transposition) and @code{h}
is upper Hessenberg (@code{i >= j+1 => h (i, j) = 0}).
@end ifinfo
@end deftypefn
input
-*- texinfo -*-
@deftypefn {Built-in Function} {} input (@var{prompt})
@deftypefnx {Built-in Function} {} input (@var{prompt}, "s")
Print a prompt and wait for user input.  For example,

@example
input ("Pick a number, any number! ")
@end example

@noindent
prints the prompt

@example
Pick a number, any number!
@end example

@noindent
and waits for the user to enter a value.  The string entered by the user
is evaluated as an expression, so it may be a literal constant, a
variable name, or any other valid expression.

Currently, @code{input} only returns one value, regardless of the number
of values produced by the evaluation of the expression.

If you are only interested in getting a literal string value, you can
call @code{input} with the character string @code{"s"} as the second
argument.  This tells Octave to return the string entered by the user
directly, without evaluating it first.

Because there may be output waiting to be displayed by the pager, it is
a good idea to always call @code{fflush (stdout)} before calling
@code{input}.  This will ensure that all pending output is written to
the screen before your prompt.  @xref{Input and Output}.
@end deftypefn
keyboard
-*- texinfo -*-
@deftypefn {Built-in Function} {} keyboard (@var{prompt})
This function is normally used for simple debugging.  When the
@code{keyboard} function is executed, Octave prints a prompt and waits
for user input.  The input strings are then evaluated and the results
are printed.  This makes it possible to examine the values of variables
within a function, and to assign new values to variables.  No value is
returned from the @code{keyboard} function, and it continues to prompt
for input until the user types @samp{quit}, or @samp{exit}.

If @code{keyboard} is invoked without any arguments, a default prompt of
@samp{debug> } is used.
@end deftypefn
echo
-*- texinfo -*-
@deffn {Command} echo options
Control whether commands are displayed as they are executed.  Valid
options are:

@table @code
@item on
Enable echoing of commands as they are executed in script files.

@item off
Disable echoing of commands as they are executed in script files.

@item on all
Enable echoing of commands as they are executed in script files and
functions.

@item off all
Disable echoing of commands as they are executed in script files and
functions.
@end table

@noindent
If invoked without any arguments, @code{echo} toggles the current echo
state.
@end deffn
completion_matches
-*- texinfo -*-
@deftypefn {Built-in Function} {} completion_matches (@var{hint})
Generate possible completions given @var{hint}.

This function is provided for the benefit of programs like Emacs which
might be controlling Octave and handling user input.  The current
command number is not incremented when this function is called.  This is
a feature, not a bug.
@end deftypefn
read_readline_init_file
-*- texinfo -*-
@deftypefn {Built-in Function} {} read_readline_init_file (@var{file})
Read the readline library initialiazation file @var{file}.  If
@var{file} is omitted, read the default initialization file (normally
@file{~/.inputrc}.
@end deftypefn
input_event_hook
-*- texinfo -*-
@deftypefn {Built-in Function} {[@var{ofcn}, @var{odata}] =} input_event_hook (@var{fcn}, @var{data})
Given the name of a function as a string and any Octave value object,
install @var{fcn} as a function to call periodically, when Octave is
waiting for input.  The function should have the form
@example
@var{fcn} (@var{data})
@end example

If @var{data} is omitted, Octave calls the function without any
arguments.  If both @var{fcn} and @var{data} are omitted, Octave
clears the hook.  In all cases, the name of the previous hook function
and the user data are returned.
@end deftypefn
PS1
-*- texinfo -*-
@defvr {Built-in Variable} PS1
The primary prompt string.  When executing interactively, Octave
displays the primary prompt @code{PS1} when it is ready to read a
command.

The default value of @code{PS1} is @code{"\s:\#> "}.  To change it, use a
command like

@example
octave:13> PS1 = "\\u@@\\H> "
@end example

@noindent
which will result in the prompt @samp{boris@@kremvax> } for the user
@samp{boris} logged in on the host @samp{kremvax.kgb.su}.  Note that two
backslashes are required to enter a backslash into a string.
@xref{Strings}.
@end defvr
PS2
-*- texinfo -*-
@defvr {Built-in Variable} PS2
The secondary prompt string, which is printed when Octave is
expecting additional input to complete a command.  For example, when
defining a function over several lines, Octave will print the value of
@code{PS1} at the beginning of each line after the first.  The default
value of @code{PS2} is @code{"> "}.
@end defvr
PS4
-*- texinfo -*-
@defvr {Built-in Variable} PS4
If Octave is invoked with the @code{--echo-input} option, the value of
@code{PS4} is printed before each line of input that is echoed.  The
default value of @code{PS4} is @code{"+ "}.  @xref{Invoking Octave}, for
a description of @code{--echo-input}.
@end defvr
completion_append_char
-*- texinfo -*-
@defvr {Built-in Variable} completion_append_char
The value of @code{completion_append_char} is used as the character to
append to successful command-line completion attempts.  The default
value is @code{" "} (a single space).
@end defvr
echo_executing_commands
-*- texinfo -*-
@defvr {Built-in Variable} echo_executing_commands
This variable may also be used to control the echo state.  It may be
the sum of the following values:

@table @asis
@item 1
Echo commands read from script files.

@item 2
Echo commands from functions.

@item 4
Echo commands read from command line.
@end table

More than one state can be active at once.  For example, a value of 3 is
equivalent to the command @kbd{echo on all}.

The value of @code{echo_executing_commands} is set by the @kbd{echo}
command and the command line option @code{--echo-input}.
@end defvr
inv
-*- texinfo -*-
@deftypefn {Loadable Function} {[@var{x}, @var{rcond}] = } inv (@var{a})
@deftypefnx {Loadable Function} {[@var{x}, @var{rcond}] = } inverse (@var{a})
Compute the inverse of the square matrix @var{a}.  Return an estimate
of the reciprocal condition number if requested, otherwise warn of an
ill-conditioned matrix if the reciprocal condition number is small.
@end deftypefn
inverse
-*- texinfo -*-
@deftypefn {Loadable Function} {} inverse (@var{a})
See inv.
@end deftypefn
kron
-*- texinfo -*-
@deftypefn {Function File} {} kron (@var{a}, @var{b})
Form the kronecker product of two matrices, defined block by block as

@example
x = [a(i, j) b]
@end example

For example,

@example
@group
kron (1:4, ones (3, 1))
      @result{}  1  2  3  4
          1  2  3  4
          1  2  3  4
@end group
@end example
@end deftypefn
iskeyword
-*- texinfo -*-
@deftypefn {Built-in Function} {} iskeyword (@var{name})
Return true if @var{name} is an Octave keyword.  If @var{name}
is omitted, return a list of keywords.
@end deftypefn
warn_matlab_incompatible
-*- texinfo -*-
@defvr {Built-in Variable} warn_matlab_incompatible
Print warnings for Octave language features that may cause
compatibility problems with Matlab.
@end defvr
warn_separator_insert
-*- texinfo -*-
@defvr {Built-in Variable} warn_separator_insert
Print warning if commas or semicolons might be inserted
automatically in literal matrices.
@end defvr
warn_single_quote_string
-*- texinfo -*-
@defvr {Built-in Variable} warn_single_quote_string
Print warning if a signle quote character is used to introduce a
string constant.
@end defvr
load
-*- texinfo -*-
@deffn {Command} load options file v1 v2 @dots{}
Load the named variables from the file @var{file}.  As with @code{save},
you may specify a list of variables and @code{load} will only extract
those variables with names that match.  For example, to restore the
variables saved in the file @file{data}, use the command

@example
load data
@end example

Octave will refuse to overwrite existing variables unless you use the
option @samp{-force}.

If a variable that is not marked as global is loaded from a file when a
global symbol with the same name already exists, it is loaded in the
global symbol table.  Also, if a variable is marked as global in a file
and a local symbol exists, the local symbol is moved to the global
symbol table and given the value from the file.  Since it seems that
both of these cases are likely to be the result of some sort of error,
they will generate warnings.

If invoked with a single output argument, Octave returns data instead
of inserting variables in the symbol table.  If the data file contains
only numbers (TAB- or space-delimited columns), a matrix of values is
returned.  Otherwise, @code{load} returns a structure with members
 corresponding to the names of the variables in the file.

The @code{load} command can read data stored in Octave's text and
binary formats, and @sc{Matlab}'s binary format.  It will automatically
detect the type of file and do conversion from different floating point
formats (currently only IEEE big and little endian, though other formats
may added in the future).

Valid options for @code{load} are listed in the following table.

@table @code
@item -force
Force variables currently in memory to be overwritten by variables with
the same name found in the file.

@item -ascii
Force Octave to assume the file is in Octave's text format.

@item -binary
Force Octave to assume the file is in Octave's binary format.

@item -mat-binary
Force Octave to assume the file is in @sc{Matlab}'s binary format.

@item -mat4-binary
Force Octave to assume the file is in the binary format written by
@sc{Matlab} version 4.

@item -hdf5
Force Octave to assume the file is in HDF5 format.
(HDF5 is a free, portable binary format developed by the National
Center for Supercomputing Applications at the University of Illinois.)
Note that Octave can read HDF5 files not created by itself, but may
skip some datasets in formats that it cannot support.

HDF5 load and save are not available, as this Octave executable was
not linked with the HDF5 library.
@item -import
The @samp{-import} is acceptted but ignored for backward compatiability.
Octave can now support multi-dimensional HDF data and automatically modifies
variable names if they are invalid Octave identifiers.

@end table
@end deffn
save
-*- texinfo -*-
@deffn {Command} save options file v1 v2 @dots{}
Save the named variables @var{v1}, @var{v2}, @dots{} in the file
@var{file}.  The special filename @samp{-} can be used to write the
output to your terminal.  If no variable names are listed, Octave saves
all the variables in the current scope.  Valid options for the
@code{save} command are listed in the following table.  Options that
modify the output format override the format specified by the built-in
variable @code{default_save_format}.

@table @code
@item -ascii
Save the data in Octave's text data format.

@item -binary
Save the data in Octave's binary data format.

@item -float-binary
Save the data in Octave's binary data format but only using single
precision.  You should use this format only if you know that all the
values to be saved can be represented in single precision.

@item -mat-binary
Save the data in @sc{Matlab}'s binary data format.

@item -mat4-binary
Save the data in the binary format written by @sc{Matlab} version 4.

@item -hdf5
Save the data in HDF5 format.
(HDF5 is a free, portable binary format developed by the National
Center for Supercomputing Applications at the University of Illinois.)

HDF5 load and save are not available, as this Octave executable was
not linked with the HDF5 library.
@item -float-hdf5
Save the data in HDF5 format but only using single precision.
You should use this format only if you know that all the
values to be saved can be represented in single precision.

@item -save-builtins
Force Octave to save the values of built-in variables too.  By default,
Octave does not save built-in variables.
@end table

The list of variables to save may include wildcard patterns containing
the following special characters:
@table @code
@item ?
Match any single character.

@item *
Match zero or more characters.

@item [ @var{list} ]
Match the list of characters specified by @var{list}.  If the first
character is @code{!} or @code{^}, match all characters except those
specified by @var{list}.  For example, the pattern @samp{[a-zA-Z]} will
match all lower and upper case alphabetic characters. 
@end table

Except when using the @sc{Matlab} binary data file format, saving global
variables also saves the global status of the variable, so that if it is
restored at a later time using @samp{load}, it will be restored as a
global variable.

The command

@example
save -binary data a b*
@end example

@noindent
saves the variable @samp{a} and all variables beginning with @samp{b} to
the file @file{data} in Octave's binary format.
@end deffn
crash_dumps_octave_core
-*- texinfo -*-
@defvr {Built-in Variable} crash_dumps_octave_core
If this variable is set to a nonzero value, Octave tries to save all
current variables the the file "octave-core" if it crashes or receives a
hangup, terminate or similar signal.  The default value is 1.
@seealso{octave_core_file_limit, octave_core_file_name, and octave_core_file_format}
@end defvr
default_save_format
-*- texinfo -*-
@defvr {Built-in Variable} default_save_format
This variable specifies the default format for the @code{save} command.
It should have one of the following values: @code{"ascii"},
@code{"binary"}, @code{float-binary}, or @code{"mat-binary"}.  The
initial default save format is Octave's text format.
@end defvr
octave_core_file_limit
-*- texinfo -*-
@defvr {Built-in Variable} octave_core_file_limit
The maximum amount of memory (in kilobytes) of the top-level workspace
that Octave will attempt to write when saving data to the
@var{octave_core_file_name}.  If @var{octave_core_file_format} is a
binary format, then @var{octave_core_file_limit} will be approximately
the maximum size of the file.  If a text file format is used, then the
file could be much larger than the limit.
The default value is -1 (unlimited)
@seealso{crash_dumps_octave_core, octave_core_file_name, and octave_core_file_format}
@end defvr
octave_core_file_name
-*- texinfo -*-
@defvr {Built-in Variable} octave_core_file_name
The name of the file used for saving data from the top-level workspace
when Octave aborts.  The default value is @code{"octave-core"}
@seealso{crash_dumps_octave_core, octave_core_file_name, and octave_core_file_format}
@end defvr
octave_core_file_format
-*- texinfo -*-
@defvr {Built-in Variable} octave_core_file_format
If Octave aborts, it attempts to save the contents of the top-level
workspace in a file using this format.  The value of
@code{octave_core_file_format} should have one of the following values:
@code{"ascii"}, @code{"binary"}, @code{float-binary}, or
@code{"mat-binary"}.  The default value is Octave's binary format.
@seealso{crash_dumps_octave_core, octave_core_file_name, and octave_core_file_limit}
@end defvr
save_header_format_string
-*- texinfo -*-
@defvr {Built-in Variable} save_header_format_string
This variable specifies the the format string for the comment line
that is written at the beginning of text-format data files saved by
Octave.  The format string is passed to @code{strftime} and should
begin with the character @samp{#} and contain no newline characters.
If the value of @code{save_header_format_string} is the empty string,
the header comment is omitted from text-format data files.  The
default value is

@example
"# Created by Octave VERSION, %a %b %d %H:%M:%S %Y %Z <USER@@HOST>"
@end example
@seealso{strftime}
@end defvr
lpsolve
-*- texinfo -*-
@deftypefn {Loadable Function} {} lpsolve ()
Not implemented yet...
@end deftypefn
lpsolve_options
-*- texinfo -*-
@deftypefn {Loadable Function} {} lpsolve_options ()
Not implemented yet...
@end deftypefn
save_precision
-*- texinfo -*-
@defvr {Built-in Variable} save_precision
This variable specifies the number of digits to keep when saving data in
text format.  The default value is 17.
@end defvr
lsode_options
-*- texinfo -*-
@deftypefn {Loadable Function} {} lsode_options (@var{opt}, @var{val})
When called with two arguments, this function
allows you set options parameters for the function @code{lsode}.
Given one argument, @code{lsode_options} returns the value of the
corresponding option.  If no arguments are supplied, the names of all
the available options and their current values are displayed.

Options include

@table @code
@item "absolute tolerance"
Absolute tolerance.  May be either vector or scalar.  If a vector, it
must match the dimension of the state vector.
@item "relative tolerance"
Relative tolerance parameter.  Unlike the absolute tolerance, this
parameter may only be a scalar.

The local error test applied at each integration step is

@example
  abs (local error in x(i)) <= rtol * abs (y(i)) + atol(i)
@end example
@item "integration method"
A string specifing the method of integration to use to solve the ODE
system.  Valid values are

@table @asis
@item "adams"
@itemx "non-stiff"
No Jacobian used (even if it is available).
@item "bdf"
@item "stiff"
Use stiff backward differentiation formula (BDF) method.  If a
function to compute the Jacobian is not supplied, @code{lsode} will
compute a finite difference approximation of the Jacobian matrix.
@end table
@item "initial step size"
The step size to be attempted on the first step (default is determined
automatically).
@item "maximum order"
Restrict the maximum order of the solution method.  If using the Adams
method, this option must be between 1 and 12.  Otherwise, it must be
between 1 and 5, inclusive.
@item "maximum step size"
Setting the maximum stepsize will avoid passing over very large
regions  (default is not specified).
@item "minimum step size"
The minimum absolute step size allowed (default is 0).
@item "step limit"
Maximum number of steps allowed (default is 100000).
@end table
@end deftypefn
lsode
-*- texinfo -*-
@deftypefn {Loadable Function} {[@var{x}, @var{istate}, @var{msg}]} lsode (@var{fcn}, @var{x_0}, @var{t}, @var{t_crit})
Solve the set of differential equations
@tex
$$ {dx \over dt} = f (x, t) $$
with
$$ x(t_0) = x_0 $$
@end tex
@ifinfo

@example
dx
-- = f(x, t)
dt
@end example

with

@example
x(t_0) = x_0
@end example

@end ifinfo
The solution is returned in the matrix @var{x}, with each row
corresponding to an element of the vector @var{t}.  The first element
of @var{t} should be @math{t_0} and should correspond to the initial
state of the system @var{x_0}, so that the first row of the output
is @var{x_0}.

The first argument, @var{fcn}, is a string that names the function to
call to compute the vector of right hand sides for the set of equations.
The function must have the form

@example
@var{xdot} = f (@var{x}, @var{t})
@end example

@noindent
in which @var{xdot} and @var{x} are vectors and @var{t} is a scalar.

If @var{fcn} is a two-element string array, the first element names the
function @math{f} described above, and the second element names a function
to compute the Jacobian of @math{f}.  The Jacobian function must have the
form

@example
@var{jac} = j (@var{x}, @var{t})
@end example

in which @var{jac} is the matrix of partial derivatives
@tex
$$ J = {\partial f_i \over \partial x_j} = \left[\matrix{
{\partial f_1 \over \partial x_1}
  & {\partial f_1 \over \partial x_2}
  & \cdots
  & {\partial f_1 \over \partial x_N} \cr
{\partial f_2 \over \partial x_1}
  & {\partial f_2 \over \partial x_2}
  & \cdots
  & {\partial f_2 \over \partial x_N} \cr
 \vdots & \vdots & \ddots & \vdots \cr
{\partial f_3 \over \partial x_1}
  & {\partial f_3 \over \partial x_2}
  & \cdots
  & {\partial f_3 \over \partial x_N} \cr}\right]$$
@end tex
@ifinfo

@example
             | df_1  df_1       df_1 |
             | ----  ----  ...  ---- |
             | dx_1  dx_2       dx_N |
             |                       |
             | df_2  df_2       df_2 |
             | ----  ----  ...  ---- |
      df_i   | dx_1  dx_2       dx_N |
jac = ---- = |                       |
      dx_j   |  .    .     .    .    |
             |  .    .      .   .    |
             |  .    .       .  .    |
             |                       |
             | df_N  df_N       df_N |
             | ----  ----  ...  ---- |
             | dx_1  dx_2       dx_N |
@end example

@end ifinfo

The second and third arguments specify the intial state of the system,
@math{x_0}, and the initial value of the independent variable @math{t_0}.

The fourth argument is optional, and may be used to specify a set of
times that the ODE solver should not integrate past.  It is useful for
avoiding difficulties with singularities and points where there is a
discontinuity in the derivative.

After a successful computation, the value of @var{istate} will be 2
(consistent with the Fortran version of @sc{Lsode}).

If the computation is not successful, @var{istate} will be something
other than 2 and @var{msg} will contain additional information.

You can use the function @code{lsode_options} to set optional
parameters for @code{lsode}.
@end deftypefn
@seealso{daspk, dassl, dasrt, odessa}
lu
-*- texinfo -*-
@deftypefn {Loadable Function} {[@var{l}, @var{u}, @var{p}] =} lu (@var{a})
@cindex LU decomposition
Compute the LU decomposition of @var{a}, using subroutines from
@sc{Lapack}.  The result is returned in a permuted form, according to
the optional return value @var{p}.  For example, given the matrix
@code{a = [1, 2; 3, 4]},

@example
[l, u, p] = lu (a)
@end example

@noindent
returns

@example
l =

  1.00000  0.00000
  0.33333  1.00000

u =

  3.00000  4.00000
  0.00000  0.66667

p =

  0  1
  1  0
@end example

The matrix is not required to be square..
@end deftypefn
abs
-*- texinfo -*-
@deftypefn {Mapping Function} {} abs (@var{z})
Compute the magnitude of @var{z}, defined as
@iftex
@tex
$|z| = \sqrt{x^2 + y^2}$.
@end tex
@end iftex
@ifinfo
|@var{z}| = @code{sqrt (x^2 + y^2)}.
@end ifinfo

For example,

@example
@group
abs (3 + 4i)
     @result{} 5
@end group
@end example
@end deftypefn
acos
-*- texinfo -*-
@deftypefn {Mapping Function} {} acos (@var{x})
Compute the inverse cosine of each element of @var{x}.
@end deftypefn
acosh
-*- texinfo -*-
@deftypefn {Mapping Function} {} acosh (@var{x})
Compute the inverse hyperbolic cosine of each element of @var{x}.
@end deftypefn
angle
-*- texinfo -*-
@deftypefn {Mapping Function} {} angle (@var{z})
See arg.
@end deftypefn
arg
-*- texinfo -*-
@deftypefn {Mapping Function} {} arg (@var{z})
@deftypefnx {Mapping Function} {} angle (@var{z})
Compute the argument of @var{z}, defined as
@iftex
@tex
$\theta = \tan^{-1}(y/x)$.
@end tex
@end iftex
@ifinfo
@var{theta} = @code{atan (@var{y}/@var{x})}.
@end ifinfo

@noindent
in radians. 

For example,

@example
@group
arg (3 + 4i)
     @result{} 0.92730
@end group
@end example
@end deftypefn
asin
-*- texinfo -*-
@deftypefn {Mapping Function} {} asin (@var{x})
Compute the inverse sine of each element of @var{x}.
@end deftypefn
asinh
-*- texinfo -*-
@deftypefn {Mapping Function} {} asinh (@var{x})
Ompute the inverse hyperbolic sine of each element of @var{x}.
@end deftypefn
atan
-*- texinfo -*-
@deftypefn {Mapping Function} {} atan (@var{x})
Compute the inverse tangent of each element of @var{x}.
@end deftypefn
atanh
-*- texinfo -*-
@deftypefn {Mapping Function} {} atanh (@var{x})
Compute the inverse hyperbolic tanget of each element of @var{x}.
@end deftypefn
ceil
-*- texinfo -*-
@deftypefn {Mapping Function} {} ceil (@var{x})
Return the smallest integer not less than @var{x}.  If @var{x} is
complex, return @code{ceil (real (@var{x})) + ceil (imag (@var{x})) * I}.
@end deftypefn
conj
-*- texinfo -*-
@deftypefn {Mapping Function} {} conj (@var{z})
Return the complex conjugate of @var{z}, defined as
@iftex
@tex
$\bar{z} = x - iy$.
@end tex
@end iftex
@ifinfo
@code{conj (@var{z})} = @var{x} - @var{i}@var{y}.
@end ifinfo
@end deftypefn
@seealso{real and imag}
cos
-*- texinfo -*-
@deftypefn {Mapping Function} {} cos (@var{x})
Compute the cosine of each element of @var{x}.
@end deftypefn
cosh
-*- texinfo -*-
@deftypefn {Mapping Function} {} cosh (@var{x})
Compute the hyperbolic cosine of each element of @var{x}.
@end deftypefn
erf
-*- texinfo -*-
@deftypefn {Mapping Function} {} erf (@var{z})
Computes the error function,
@iftex
@tex
$$
 {\rm erf} (z) = {2 \over \sqrt{\pi}}\int_0^z e^{-t^2} dt
$$
@end tex
@end iftex
@ifinfo

@smallexample
                         z
                        /
erf (z) = (2/sqrt (pi)) | e^(-t^2) dt
                        /
                     t=0
@end smallexample
@end ifinfo
@end deftypefn
@seealso{erfc and erfinv}
erfc
-*- texinfo -*-
@deftypefn {Mapping Function} {} erfc (@var{z})
Computes the complementary error function,
@iftex
@tex
$1 - {\rm erf} (z)$.
@end tex
@end iftex
@ifinfo
@code{1 - erf (@var{z})}.
@end ifinfo
@end deftypefn

@seealso{erf and erfinv}
exp
-*- texinfo -*-
@deftypefn {Mapping Function} {} exp (@var{x})
Compute the exponential of @var{x}.  To compute the matrix exponential,
see @ref{Linear Algebra}.
@end deftypefn
finite
-*- texinfo -*-
@deftypefn {Mapping Function} {} finite (@var{x})
Return 1 for elements of @var{x} that are finite values and zero
otherwise. For example,

@example
@group
finite ([13, Inf, NaN])
     @result{} [ 1, 0, 0 ]
@end group
@end example
@end deftypefn
fix
-*- texinfo -*-
@deftypefn {Mapping Function} {} fix (@var{x})
Truncate @var{x} toward zero.  If @var{x} is complex, return
@code{fix (real (@var{x})) + fix (imag (@var{x})) * I}.
@end deftypefn
floor
-*- texinfo -*-
@deftypefn {Mapping Function} {} floor (@var{x})
Return the largest integer not greater than @var{x}.  If @var{x} is
complex, return @code{floor (real (@var{x})) + floor (imag (@var{x})) * I}.
@end deftypefn
gamma
-*- texinfo -*-
@deftypefn {Mapping Function} {} gamma (@var{z})
Computes the Gamma function,
@iftex
@tex
$$
 \Gamma (z) = \int_0^\infty t^{z-1} e^{-t} dt.
$$
@end tex
@end iftex
@ifinfo

@example
            infinity
            /
gamma (z) = | t^(z-1) exp (-t) dt.
            /
         t=0
@end example
@end ifinfo
@end deftypefn

@seealso{gammai and lgamma}
imag
-*- texinfo -*-
@deftypefn {Mapping Function} {} imag (@var{z})
Return the imaginary part of @var{z} as a real number.
@end deftypefn

@seealso{real and conj}
isalnum
-*- texinfo -*-
@deftypefn {Mapping Function} {} isalnum (@var{s})
Return 1 for characters that are letters or digits (@code{isalpha
(@var{s})} or @code{isdigit (@var{s})} is true).
@end deftypefn
isalpha
-*- texinfo -*-
@deftypefn {Mapping Function} {} isalpha (@var{s})
@deftypefnx {Mapping Function} {} isletter (@var{s})
Return true for characters that are letters (@code{isupper (@var{s})}
or @code{islower (@var{s})} is true).
@end deftypefn
isascii
-*- texinfo -*-
@deftypefn {Mapping Function} {} isascii (@var{s})
Return 1 for characters that are ASCII (in the range 0 to 127 decimal).
@end deftypefn
iscntrl
-*- texinfo -*-
@deftypefn {Mapping Function} {} iscntrl (@var{s})
Return 1 for control characters.
@end deftypefn
isdigit
-*- texinfo -*-
@deftypefn {Mapping Function} {} isdigit (@var{s})
Return 1 for characters that are decimal digits.
@end deftypefn
isinf
-*- texinfo -*-
@deftypefn {Mapping Function} {} isinf (@var{x})
Return 1 for elements of @var{x} that are infinite and zero
otherwise. For example,

@example
@group
isinf ([13, Inf, NA, NaN])
     @result{} [ 0, 1, 0, 0 ]
@end group
@end example
@end deftypefn
isgraph
-*- texinfo -*-
@deftypefn {Mapping Function} {} isgraph (@var{s})
Return 1 for printable characters (but not the space character).
@end deftypefn
islower
-*- texinfo -*-
@deftypefn {Mapping Function} {} islower (@var{s})
Return 1 for characters that are lower case letters.
@end deftypefn
isna
-*- texinfo -*-
@deftypefn {Mapping Function} {} isna (@var{x})
Return 1 for elements of @var{x} that are NA (missing) values and zero
otherwise. For example,

@example
@group
is_NA ([13, Inf, NA, NaN])
     @result{} [ 0, 0, 1, 0 ]
@end group
@end example
@end deftypefn
is_nan_or_na
-*- texinfo -*-
@deftypefn {Mapping Function} {} is_nan_or_na (@var{x})
Return 1 for elements of @var{x} that are NaN or NA (missing) values
and zero otherwise. For example,

@example
@group
is_NAN_or_NA ([13, Inf, NA, NaN])
     @result{} [ 0, 0, 1, 1 ]
@end group
@end example
@end deftypefn
isnan
-*- texinfo -*-
@deftypefn {Mapping Function} {} isnan (@var{x})
Return 1 for elements of @var{x} that are NaN values and zero
otherwise. For example,

@example
@group
isnan ([13, Inf, NA, NaN])
     @result{} [ 0, 0, 0, 1 ]
@end group
@end example
@end deftypefn
isprint
-*- texinfo -*-
@deftypefn {Mapping Function} {} isprint (@var{s})
Return 1 for printable characters (including the space character).
@end deftypefn
ispunct
-*- texinfo -*-
@deftypefn {Mapping Function} {} ispunct (@var{s})
Return 1 for punctuation characters.
@end deftypefn
isspace
-*- texinfo -*-
@deftypefn {Mapping Function} {} isspace (@var{s})
Return 1 for whitespace characters (space, formfeed, newline,
carriage return, tab, and vertical tab).
@end deftypefn
isupper
-*- texinfo -*-
@deftypefn {Mapping Function} {} isupper (@var{s})
Return 1 for upper case letters.
@end deftypefn
isxdigit
-*- texinfo -*-
@deftypefn {Mapping Function} {} isxdigit (@var{s})
Return 1 for characters that are hexadecimal digits.
@end deftypefn
lgamma
-*- texinfo -*-
@deftypefn {Mapping Function} {} lgamma (@var{a}, @var{x})
@deftypefnx {Mapping Function} {} gammaln (@var{a}, @var{x})
Return the natural logarithm of the gamma function.
@end deftypefn
@seealso{gamma and gammai}
log
-*- texinfo -*-
@deftypefn {Mapping Function} {} log (@var{x})
Compute the natural logarithm for each element of @var{x}.  To compute the
matrix logarithm, see @ref{Linear Algebra}.
@end deftypefn
@seealso{log2, log10, logspace, and exp}
log10
-*- texinfo -*-
@deftypefn {Mapping Function} {} log10 (@var{x})
Compute the base-10 logarithm for each element of @var{x}.
@end deftypefn
@seealso{log, log2, logspace, and exp}
real
-*- texinfo -*-
@deftypefn {Mapping Function} {} real (@var{z})
Return the real part of @var{z}.
@end deftypefn
@seealso{imag and conj}
round
-*- texinfo -*-
@deftypefn {Mapping Function} {} round (@var{x})
Return the integer nearest to @var{x}.  If @var{x} is complex, return
@code{round (real (@var{x})) + round (imag (@var{x})) * I}.
@end deftypefn
@seealso{rem}
sign
-*- texinfo -*-
@deftypefn {Mapping Function} {} sign (@var{x})
Compute the @dfn{signum} function, which is defined as
@iftex
@tex
$$
{\rm sign} (@var{x}) = \cases{1,&$x>0$;\cr 0,&$x=0$;\cr -1,&$x<0$.\cr}
$$
@end tex
@end iftex
@ifinfo

@example
           -1, x < 0;
sign (x) =  0, x = 0;
            1, x > 0.
@end example
@end ifinfo

For complex arguments, @code{sign} returns @code{x ./ abs (@var{x})}.
@end deftypefn
sin
-*- texinfo -*-
@deftypefn {Mapping Function} {} sin (@var{x})
Compute the sin of each element of @var{x}.
@end deftypefn
sinh
-*- texinfo -*-
@deftypefn {Mapping Function} {} sinh (@var{x})
Compute the inverse hyperbolic sin of each element of @var{x}.
@end deftypefn
sqrt
-*- texinfo -*-
@deftypefn {Mapping Function} {} sqrt (@var{x})
Compute the square root of @var{x}.  If @var{x} is negative, a complex
result is returned.  To compute the matrix square root, see
@ref{Linear Algebra}.
@end deftypefn
tan
-*- texinfo -*-
@deftypefn {Mapping Function} {} tan (@var{z})
Compute tanget of each element of @var{x}.
@end deftypefn
tanh
-*- texinfo -*-
@deftypefn {Mapping Function} {} tanh (@var{x})
Compute hyperbolic tangent of each element of @var{x}.
@end deftypefn
toascii
-*- texinfo -*-
@deftypefn {Mapping Function} {} toascii (@var{s})
Return ASCII representation of @var{s} in a matrix.  For example,

@example
@group
toascii ("ASCII")
     @result{} [ 65, 83, 67, 73, 73 ]
@end group

@end example
@end deftypefn
tolower
-*- texinfo -*-
@deftypefn {Mapping Function} {} tolower (@var{s})
Return a copy of the string @var{s}, with each upper-case character
replaced by the corresponding lower-case one; nonalphabetic characters
are left unchanged.  For example,

@example
tolower ("MiXeD cAsE 123")
     @result{} "mixed case 123"
@end example
@end deftypefn
toupper
-*- texinfo -*-
@deftypefn {Built-in Function} {} toupper (@var{s})
Return a copy of the string @var{s}, with each  lower-case character
replaced by the corresponding upper-case one; nonalphabetic characters
are left unchanged.  For example,

@example
@group
toupper ("MiXeD cAsE 123")
     @result{} "MIXED CASE 123"
@end group
@end example
@end deftypefn
min
-*- texinfo -*-
@deftypefn {Mapping Function} {} min (@var{x}, @var{y})
@deftypefnx {Mapping Function} {[@var{w}, @var{iw}] =} min (@var{x})
@cindex Utility Functions
For a vector argument, return the minimum value.  For a matrix
argument, return the minimum value from each column, as a row
vector.
For two matrices (or a matrix and scalar),
return the pair-wise minimum.
Thus,

@example
min (min (@var{x}))
@end example

@noindent
returns the smallest element of @var{x}, and

@example
@group
min (2:5, pi)
    @result{}  2.0000  3.0000  3.1416  3.1416
@end group
@end example
@noindent
compares each element of the range @code{2:5} with @code{pi}, and
returns a row vector of the minimum values.

For complex arguments, the magnitude of the elements are used for
comparison.

If called with one input and two output arguments,
@code{min} also returns the first index of the
minimum value(s). Thus,

@example
@group
[x, ix] = min ([1, 3, 0, 2, 5])
    @result{}  x = 0
        ix = 3
@end group
@end example
@end deftypefn
max
-*- texinfo -*-
@deftypefn {Mapping Function} {} max (@var{x}, @var{y})
@deftypefnx {Mapping Function} {[@var{w}, @var{iw}] =} max (@var{x})
@cindex Utility Functions
For a vector argument, return the maximum value.  For a matrix
argument, return the maximum value from each column, as a row
vector.
For two matrices (or a matrix and scalar),
return the pair-wise maximum.
Thus,

@example
max (max (@var{x}))
@end example

@noindent
returns the largest element of @var{x}, and

@example
@group
max (2:5, pi)
    @result{}  3.1416  3.1416  4.0000  5.0000
@end group
@end example
@noindent
compares each element of the range @code{2:5} with @code{pi}, and
returns a row vector of the maximum values.

For complex arguments, the magnitude of the elements are used for
comparison.

If called with one input and two output arguments,
@code{max} also returns the first index of the
maximum value(s). Thus,

@example
@group
[x, ix] = max ([1, 3, 5, 2, 5])
    @result{}  x = 5
        ix = 3
@end group
@end example
@end deftypefn
edit_history
-*- texinfo -*-
@deffn {Command} edit_history options
If invoked with no arguments, @code{edit_history} allows you to edit the
history list using the editor named by the variable @code{EDITOR}.  The
commands to be edited are first copied to a temporary file.  When you
exit the editor, Octave executes the commands that remain in the file.
It is often more convenient to use @code{edit_history} to define functions 
rather than attempting to enter them directly on the command line.
By default, the block of commands is executed as soon as you exit the
editor.  To avoid executing any commands, simply delete all the lines
from the buffer before exiting the editor.

The @code{edit_history} command takes two optional arguments specifying
the history numbers of first and last commands to edit.  For example,
the command

@example
edit_history 13
@end example

@noindent
extracts all the commands from the 13th through the last in the history
list.  The command

@example
edit_history 13 169
@end example

@noindent
only extracts commands 13 through 169.  Specifying a larger number for
the first command than the last command reverses the list of commands
before placing them in the buffer to be edited.  If both arguments are
omitted, the previous command in the history list is used.
@end deffn
history
-*- texinfo -*-
@deffn {Command} history options
If invoked with no arguments, @code{history} displays a list of commands
that you have executed.  Valid options are:

@table @code
@item -w @var{file}
Write the current history to the file @var{file}.  If the name is
omitted, use the default history file (normally @file{~/.octave_hist}).

@item -r @var{file}
Read the file @var{file}, replacing the current history list with its
contents.  If the name is omitted, use the default history file
(normally @file{~/.octave_hist}).

@item @var{n}
Only display the most recent @var{n} lines of history.

@item -q
Don't number the displayed lines of history.  This is useful for cutting
and pasting commands if you are using the X Window System.
@end table

For example, to display the five most recent commands that you have
typed without displaying line numbers, use the command
@kbd{history -q 5}.
@end deffn
run_history
-*- texinfo -*-
@deffn {Command} run_history [first] [last]
Similar to @code{edit_history}, except that the editor is not invoked,
and the commands are simply executed as they appear in the history list.
@end deffn
history_file
-*- texinfo -*-
@defvr {Built-in Variable} history_file
This variable specifies the name of the file used to store command
history.  The default value is @code{"~/.octave_hist"}, but may be
overridden by the environment variable @code{OCTAVE_HISTFILE}.
@end defvr
history_size
-*- texinfo -*-
@defvr {Built-in Variable} history_size
This variable specifies how many entries to store in the history file.
The default value is @code{1024}, but may be overridden by the
environment variable @code{OCTAVE_HISTSIZE}.
@end defvr
saving_history
-*- texinfo -*-
@defvr {Built-in Variable} saving_history
If the value of @code{saving_history} is nonzero, command entered
on the command line are saved in the file specified by the variable
@code{history_file}.
@end defvr
__kluge_procbuf_delay__
-*- texinfo -*-
@defvr __kluge_procbuf_delay__
Number of microseconds to delay in the parent after forking.
@end defvr
odessa_options
-*- texinfo -*-
@deftypefn {Loadable Function} {} odessa_options (@var{opt}, @var{val})
When called with two arguments, this function
allows you set options parameters for the function @code{odessa}.
Given one argument, @code{odessa_options} returns the value of the
corresponding option.  If no arguments are supplied, the names of all
the available options and their current values are displayed.

Options include

@table @code
@item "absolute tolerance"
Absolute tolerance.  May be either vector or scalar.  If a vector, it
must match the dimension of the state vector.
@item "relative tolerance"
Relative tolerance parameter.  Unlike the absolute tolerance, this
parameter may only be a scalar.

The local error test applied at each integration step is

@example
  abs (local error in x(i)) <= rtol * abs (y(i)) + atol(i)
@end example
@item "integration method"
A string specifing the method of integration to use to solve the ODE
system.  Valid values are

@table @asis
@item "adams"
@itemx "non-stiff"
No Jacobian used (even if it is available).
@item "bdf"
@item "stiff"
Use stiff backward differentiation formula (BDF) method.  If a
function to compute the Jacobian is not supplied, @code{lsode} will
compute a finite difference approximation of the Jacobian matrix.
@end table
@item "initial step size"
The step size to be attempted on the first step (default is determined
automatically).
@item "maximum order"
Restrict the maximum order of the solution method.  If using the Adams
method, this option must be between 1 and 12.  Otherwise, it must be
between 1 and 5, inclusive.
@item "maximum step size"
Setting the maximum stepsize will avoid passing over very large
regions  (default is not specified).
@item "minimum step size"
The minimum absolute step size allowed (default is 0).
@item "step limit"
Maximum number of steps allowed (default is 100000).
@end table
@end deftypefn
odessa
-*- texinfo -*-
@deftypefn {Loadable Function} {[@var{x}, @var{sx}, @var{istate}, @var{msg}]} odessa (@var{fcn}, @var{x_0}, @var{p}, @var{sx_0}, @var{t}, @var{t_crit})
Solve the set of differential equations
@tex
$$ {dx \over dt} = f (x, t; p) $$
with
$$ x(t_0) = x_0 $$
@end tex
@ifinfo

@example
dx
-- = f(x, t; p)
dt
@end example

with

@example
x(t_0) = x_0
@end example

@end ifinfo
and simultaneously compute the first-order sensitivity coefficients
given by

@example
s'(t) = j(t)*s(t) + df/dp
@end example

in which

@example
s(t)  = dx(t)/dp        (sensitivity functions)
s'(t) = d(dx(t)/dp)/dt
j(t)  = df(x,t;p)/dx(t) (Jacobian matrix)
df/dp = df(x,t;p)/dp    (inhomogeneity matrix)
@end example

The solution is returned in the matrix @var{x}, with each row
corresponding to an element of the vector @var{t}.  The first element
of @var{t} should be @math{t_0} and should correspond to the initial
state of the system @var{x_0}, so that the first row of the output
is @var{x_0}.

The sensitivities are returned in a list of matrices, @var{sx},
with each element of the list corresponding to an element of the
vector @var{t}.

The first argument, @var{fcn}, is a string that names the function to
call to compute the vector of right hand sides for the set of equations.
The function must have the form

@example
@var{xdot} = f (@var{x}, @var{t}, @var{p})
@end example

@noindent
in which @var{xdot} and @var{x} are vectors and @var{t} is a scalar.

The variable @var{p} is a vector of parameters.

The @var{fcn} argument may also be an array of strings

@example
["f"; "j"; "b"]
@end example

in which the first element names the function @math{f} described
above, the second element names a function to compute the Jacobian
of @math{f}, and the third element names a function to compute the
inhomogeneity matrix.

The Jacobian function must have the form

@example
@var{jac} = j (@var{x}, @var{t}, @var{p})
@end example

in which @var{x}, @var{t}, and @var{p} have the same meanings as
above for the function @var{f}, and  @var{jac} is the matrix of
partial derivatives
@tex
$$ J = {\partial f_i \over \partial x_j} $$
@end tex
@ifinfo

@example
      df_i
jac = ----
      dx_j
@end example

@end ifinfo

The function @var{b} must have the form

@example
@var{dfdp} = b (@var{x}, @var{t}, @var{p}, @var{c})
@end example

in which @var{x}, @var{t}, and @var{p} have the same meanings as
above for the function @var{f}, @var{c} indicates which partial
derivatives to return in @var{dfdp}.  For example, if @var{c} is 2,
you should return the vector

@example
       df_i
dfdp = ----,    i = 1:length(x)
       dp_2
@end example

The second argument, @var{x_0}, specifies the intial state of the system.

The third argument, @var{p}, specifies the set of parameters.

The fourth argument, @var{sx_0} specifies the initial values of the
sensitivities.

The sixth argument is optional, and may be used to specify a set of
times that the ODE solver should not integrate past.  It is useful for
avoiding difficulties with singularities and points where there is a
discontinuity in the derivative.

After a successful computation, the value of @var{istate} will be 2
(consistent with the Fortran version of @sc{Odessa}).

If the computation is not successful, @var{istate} will be something
other than 2 and @var{msg} will contain additional information.

You can use the function @code{lsode_options} to set optional
parameters for @code{lsode}.
@end deftypefn
@seealso{daspk, dassl, dasrt, lsode}
iscell
-*- texinfo -*-
@deftypefn {Built-in Function} {} iscell (@var{x})
Return true if @var{x} is a cell array object.  Otherwise, return
false.
@end deftypefn
cell
-*- texinfo -*-
@deftypefn {Built-in Function} {} cell (@var{x})
@deftypefnx {Built-in Function} {} cell (@var{n}, @var{m})
Create a new cell array object.  If invoked with a single scalar
argument, @code{cell} returns a square cell array with the dimension
specified.  If you supply two scalar arguments, @code{cell} takes
them to be the number of rows and columns.  If given a vector with two
elements, @code{cell} uses the values of the elements as the number of
rows and columns, respectively.
@end deftypefn
iscellstr
-*- texinfo -*-
@deftypefn {Built-in Function} {} iscellstr (@var{cell})
Return true if every element of the cell array @var{cell} is a
character string
@end deftypefn
cellstr
-*- texinfo -*-
@deftypefn {Built-in Function} {} cellstr (@var{string})
Create a new cell array object from the elements of the string
array @var{string}.
@end deftypefn
struct2cell
-*- texinfo -*-
@deftypefn {Built-in Function} {} struct2cell (@var{S})
Create a new cell array from the objects stored in the struct object.
If @var{f} is the number of fields in the structure, the resulting
cell array will have a dimension vector corresponding to
@code{[@var{F} size(@var{S})]}.
@end deftypefn
@seealso{cell2struct, fieldnames}
functions
-*- texinfo -*-
@deftypefn {Built-in Function} {} functions (@var{fcn_handle})
Return a struct containing information about the function handle
@var{fcn_handle}.
@end deftypefn
func2str
-*- texinfo -*-
@deftypefn {Built-in Function} {} func2str (@var{fcn_handle})
Return a string containing the name of the function referenced by
the function handle @var{fcn_handle}.
@end deftypefn
str2func
-*- texinfo -*-
@deftypefn {Built-in Function} {} str2func (@var{fcn_name})
Return a function handle constructed from the string @var{fcn_name}.
@end deftypefn
list
-*- texinfo -*-
@deftypefn {Built-in Function} {} list (@var{a1}, @var{a2}, @dots{})
Create a new list with elements given by the arguments @var{a1},
@var{a2}, @dots{}.
@end deftypefn
nth
-*- texinfo -*-
@deftypefn {Built-in Function} {} nth (@var{list}, @var{n})
Return the @var{n}-th element of @var{list}.
@end deftypefn
append
-*- texinfo -*-
@deftypefn {Built-in Function} {} append (@var{list}, @var{a1}, @var{a2}, @dots{})
Return a new list created by appending @var{a1}, @var{a1}, @dots{}, to
@var{list}.  If any of the arguments to be appended is a list, its
elements are appended individually.  For example,

@example
x = list (1, 2);
y = list (3, 4);
append (x, y);
@end example

@noindent
results in the list containing the four elements @samp{(1 2 3 4)}, not
a list containing the three elements @samp{(1 2 (3 4))}.
@end deftypefn
reverse
-*- texinfo -*-
@deftypefn {Built-in Function} {} reverse (@var{list})
Return a new list created by reversing the elements of @var{list}.
@end deftypefn
splice
-*- texinfo -*-
@deftypefn {Built-in Function} {} splice (@var{list_1}, @var{offset}, @var{length}, @var{list_2})
Replace @var{length} elements of @var{list_1} beginning at
@var{offset} with the contents of @var{list_2} (if any).  If
@var{length} is omitted, all elements from @var{offset} to the end of
@var{list_1} are replaced.  As a special case, if @var{offset} is one
greater than the length of @var{list_1} and @var{length} is 0, splice
is equivalent to @code{append (@var{list_1}, @var{list_2})}.
@end deftypefn
isstreamoff
-*- texinfo -*-
@deftypefn {Built-in Function} {} isstreamoff (@var{x})
Return true if @var{x} is a streamoff object.  Otherwise, return
false.
@end deftypefn
streamoff
-*- texinfo -*-
@deftypefn {Built-in Function} {} streamoff (@var{x})
@deftypefnx {Built-in Function} {} streamoff (@var{n}, @var{m})
Create a new streamoff array object.  If invoked with a single scalar
argument, @code{streamoff} returns a square streamoff array with
the dimension specified.  If you supply two scalar arguments,
@code{streamoff} takes them to be the number of rows and columns.
If given a vector with two elements, @code{streamoff} uses the values
of the elements as the number of rows and columns, respectively.
@end deftypefn
struct
-*- texinfo -*-
@deftypefn {Built-in Function} {} struct ("field", @var{value}, "field", @var{value}, @dots{})

Create a structure and initialize its value.

If the values are cell arrays, create a structure array and initialize
its values.  The dimensions of each cell array of values must match.
Singleton cells and non-cell values are repeated so that they fill
the entire array.  If the cells are empty, create an empty structure
array with the specified field names.
isstruct
-*- texinfo -*-
@deftypefn {Built-in Function} {} isstruct (@var{expr})
Return 1 if the value of the expression @var{expr} is a structure.
@end deftypefn
fieldnames
-*- texinfo -*-
@deftypefn {Built-in Function} {} fieldnames (@var{struct})
Return a cell array of strings naming the elements of the structure
@var{struct}.  It is an error to call @code{fieldnames} with an
argument that is not a structure.
@end deftypefn
isfield
-*- texinfo -*-
@deftypefn {Built-in Function} {} isfield (@var{expr}, @var{name})
Return true if the expression @var{expr} is a structure and it includes an
element named @var{name}.  The first argument must be a structure and
the second must be a string.
@end deftypefn
cell2struct
-*- texinfo -*-
@deftypefn {Built-in Function} {} cell2struct (@var{cell}, @var{fields}, @var{dim})
Convert @var{cell} to a structure. The number of fields in @var{fields}
must match the number of elements in @var{cell} along dimension @var{dim},
that is @code{numel (@var{fields}) == size (@var{cell}, @var{dim})}.

@example
@group
A = cell2struct(@{'Peter', 'Hannah', 'Robert'; 185, 170, 168@}, @{'Name','Height'@}, 1);
A(1)
@result{} ans =
      @{
        Height = 185
        Name   = Peter
      @}

@end group
@end example
@end deftypefn
rmfield
-*- texinfo -*-
@deftypefn {Built-in Function} {} rmfield (@var{s}, @var{f})
Remove field @var{f} from the structure @var{s}.  If @var{f} is a
cell array of character strings or a character array, remove the
named fields.
@end deftypefn
@seealso{cellstr, iscellstr, and setfield
typeinfo
-*- texinfo -*-
@deftypefn {Built-in Function} {} typeinfo (@var{expr})

Return the type of the expression @var{expr}, as a string.  If
@var{EXPR}  is omitted, return an array of strings containing all the
currently installed data types.
@end deftypefn
class
-*- texinfo -*-
@deftypefn {Built-in Function} {} class (@var{expr})

Return the class of the expression @var{expr}, as a string.
@end deftypefn
nargin
-*- texinfo -*-
@deftypefn {Built-in Function} {} nargin ()
@deftypefnx {Built-in Function} {} nargin (@var{fcn_name})
Within a function, return the number of arguments passed to the function.
At the top level, return the number of command line arguments passed to
Octave.  If called with the optional argument @var{fcn_name}, return the
maximum number of arguments the named function can accept, or -1 if the
function accepts a variable number of arguments.
@end deftypefn
nargout
-*- texinfo -*-
@deftypefn {Built-in Function} {} nargout ()
@deftypefnx {Built-in Function} {} nargout (@var{fcn_name})
Within a function, return the number of values the caller expects to
receive.  If called with the optional argument @var{fcn_name}, return the
maximum number of values the named function can produce, or -1 if the
function can produce a variable number of values.

For example,

@example
f ()
@end example

@noindent
will cause @code{nargout} to return 0 inside the function @code{f} and

@example
[s, t] = f ()
@end example

@noindent
will cause @code{nargout} to return 2 inside the function
@code{f}.

At the top level, @code{nargout} is undefined.
@end deftypefn
va_arg
-*- texinfo -*-
@deftypefn {Built-in Function} {} va_arg ()
Return the value of the next available argument and move the internal
pointer to the next argument.  It is an error to call @code{va_arg}
when ther eare no more arguments available, or in a function that
has not been declared to take a variable number of parameters.
@end deftypefn
va_start
-*- texinfo -*-
@deftypefn {Built-in Function} {} va_start ()
Position an internal pointer to the first unnamed argument in
functions that have been declared to accept a variable number of
arguments.  It is an error to call @code{va_start} in a function
that has not been declared to take a variable number of parameters.
@end deftypefn
vr_val
-*- texinfo -*-
@deftypefn {Built-in Function} {} vr_val (@var{x})
Each time this function is called, it places the value of its argument
at the end of the list of values to return from the current
function.  Once @code{vr_val} has been called, there is no way to go
back to the beginning of the list and rewrite any of the return
values.  This function may only be called within functions that have
been declared to return an unspecified number of output arguments.
@end deftypefn
max_recursion_depth
-*- texinfo -*-
@defvr {Built-in Variable} max_recursion_depth
Limit the number of times a function may be called recursively.
If the limit is exceeded, an error message is printed and control
returns to the top level.

The default value is 256.
@end defvr
sizeof
-*- texinfo -*-
@deftypefn {Built-in Function} {} sizeof (@var{val})
Return the size of @var{val} in bytes
@end deftypefn
print_answer_id_name
-*- texinfo -*-
@defvr {Built-in Variable} print_answer_id_name
If the value of @code{print_answer_id_name} is nonzero, variable
names are printed along with the result.  Otherwise, only the result
values are printed.  The default value is 1.
@end defvr
silent_functions
-*- texinfo -*-
@defvr {Built-in Variable} silent_functions
If the value of @code{silent_functions} is nonzero, internal output
from a function is suppressed.  Otherwise, the results of expressions
within a function body that are not terminated with a semicolon will
have their values printed.  The default value is 0.

For example, if the function

@example
function f ()
  2 + 2
endfunction
@end example

@noindent
is executed, Octave will either print @samp{ans = 4} or nothing
depending on the value of @code{silent_functions}.
@end defvr
struct_levels_to_print
-*- texinfo -*-
@defvr {Built-in Variable} struct_levels_to_print
You can tell Octave how many structure levels to display by setting the
built-in variable @code{struct_levels_to_print}.  The default value is 2.
@end defvr
warn_divide_by_zero
-*- texinfo -*-
@defvr {Built-in Variable} warn_divide_by_zero
If the value of @code{warn_divide_by_zero} is nonzero, a warning
is issued when Octave encounters a division by zero.  If the value is
0, the warning is omitted.  The default value is 1.
@end defvr
warn_fortran_indexing
-*- texinfo -*-
@defvr {Built-in Variable} warn_fortran_indexing
If the value of @code{warn_fortran_indexing} is nonzero, a warning is
printed for expressions which select elements of a two-dimensional matrix
using a single index.  The default value is 0.
@end defvr
warn_imag_to_real
-*- texinfo -*-
@defvr {Built-in Variable} warn_imag_to_real
If the value of @code{warn_imag_to_real} is nonzero, a warning is
printed for implicit conversions of complex numbers to real numbers.
The default value is 0.
@end defvr
warn_num_to_str
-*- texinfo -*-
@defvr {Built-in Variable} warn_num_to_str
If the value of @code{warn_num_to_str} is nonzero, a warning is
printed for implicit conversions of numbers to their ASCII character
equivalents when strings are constructed using a mixture of strings and
numbers in matrix notation.  For example,

@example
@group
[ "f", 111, 111 ]
     @result{} "foo"
@end group
@end example
elicits a warning if @code{warn_num_to_str} is nonzero.  The default
value is 1.
@end defvr
warn_resize_on_range_error
-*- texinfo -*-
@defvr {Built-in Variable} warn_resize_on_range_error
If the value of @code{warn_resize_on_range_error} is nonzero, print a
warning when a matrix is resized by an indexed assignment with
indices outside the current bounds.  The default value is 0.
@end defvr
warn_str_to_num
-*- texinfo -*-
@defvr {Built-in Variable} warn_str_to_num
If the value of @code{warn_str_to_num} is nonzero, a warning is printed
for implicit conversions of strings to their numeric ASCII equivalents.
For example,
@example
@group
"abc" + 0
     @result{} 97 98 99
@end group
@end example
elicits a warning if @code{warn_str_to_num} is nonzero.  The default
value is 0.
@end defvr
diary
-*- texinfo -*-
@deffn {Command} diary options
Create a list of all commands @emph{and} the output they produce, mixed
together just as you see them on your terminal.  Valid options are:

@table @code
@item on
Start recording your session in a file called @file{diary} in your
current working directory.

@item off
Stop recording your session in the diary file.

@item @var{file}
Record your session in the file named @var{file}.
@end table

Without any arguments, @code{diary} toggles the current diary state.
@end deffn
more
-*- texinfo -*-
@deffn {Command} more
@deffnx {Command} more on
@deffnx {Command} more off
Turn output pagination on or off.  Without an argument, @code{more}
toggles the current state.
@end deffn
PAGER
-*- texinfo -*-
@defvr {Built-in Variable} PAGER
The default value is normally @code{"less"}, @code{"more"}, or
@code{"pg"}, depending on what programs are installed on your system.
@xref{Installation}.

When running interactively, Octave sends any output intended for your
terminal that is more than one screen long to the program named by the
value of the variable @code{PAGER}.
@end defvr
page_output_immediately
-*- texinfo -*-
@defvr {Built-in Variable} page_output_immediately
If the value of @code{page_output_immediately} is nonzero, Octave sends
output to the pager as soon as it is available.  Otherwise, Octave
buffers its output and waits until just before the prompt is printed to
flush it to the pager.  The default value is 0.
@end defvr
page_screen_output
-*- texinfo -*-
@defvr {Built-in Variable} page_screen_output
If the value of @code{page_screen_output} is nonzero, all output
intended for the screen that is longer than one page is sent through a
pager.  This allows you to view one screenful at a time.  Some pagers
(such as @code{less}---see @ref{Installation}) are also capable of moving
backward on the output.  The default value is 1.
@end defvr
source
-*- texinfo -*-
@deftypefn {Built-in Function} {} source (@var{file})
Parse and execute the contents of @var{file}.  This is equivalent to
executing commands from a script file, but without requiring the file to
be named @file{@var{file}.m}.
@end deftypefn
feval
-*- texinfo -*-
@deftypefn {Built-in Function} {} feval (@var{name}, @dots{})
Evaluate the function named @var{name}.  Any arguments after the first
are passed on to the named function.  For example,

@example
feval ("acos", -1)
     @result{} 3.1416
@end example

@noindent
calls the function @code{acos} with the argument @samp{-1}.

The function @code{feval} is necessary in order to be able to write
functions that call user-supplied functions, because Octave does not
have a way to declare a pointer to a function (like C) or to declare a
special kind of variable that can be used to hold the name of a function
(like @code{EXTERNAL} in Fortran).  Instead, you must refer to functions
by name, and use @code{feval} to call them.
@end deftypefn
eval
-*- texinfo -*-
@deftypefn {Built-in Function} {} eval (@var{try}, @var{catch})
Parse the string @var{try} and evaluate it as if it were an Octave
program.  If that fails, evaluate the string @var{catch}.
The string @var{try} is evaluated in the current context,
so any results remain available after @code{eval} returns.
@end deftypefn
assignin
-*- texinfo -*-
@deftypefn {Built-in Function} {} assignin (@var{context}, @var{varname}, @var{value})
Assign @var{value} to @var{varname} in context @var{context}, which
may be either @code{"base"} or @code{"caller"}.
@end deftypefn
evalin
-*- texinfo -*-
@deftypefn {Built-in Function} {} evalin (@var{context}, @var{try}, @var{catch})
Like @code{eval}, except that the expressions are evaluated in the
context @var{context}, which may be either @code{"caller"} or
@code{"base"}.
@end deftypefn
warn_assign_as_truth_value
-*- texinfo -*-
@defvr {Built-in Variable} warn_assign_as_truth_value
If the value of @code{warn_assign_as_truth_value} is nonzero, a
warning is issued for statements like

@example
if (s = t)
  ...
@end example

@noindent
since such statements are not common, and it is likely that the intent
was to write

@example
if (s == t)
  ...
@end example

@noindent
instead.

There are times when it is useful to write code that contains
assignments within the condition of a @code{while} or @code{if}
statement.  For example, statements like

@example
while (c = getc())
  ...
@end example

@noindent
are common in C programming.

It is possible to avoid all warnings about such statements by setting
@code{warn_assign_as_truth_value} to 0, but that may also
let real errors like

@example
if (x = 1)  # intended to test (x == 1)!
  ...
@end example

@noindent
slip by.

In such cases, it is possible suppress errors for specific statements by
writing them with an extra set of parentheses.  For example, writing the
previous example as

@example
while ((c = getc()))
  ...
@end example

@noindent
will prevent the warning from being printed for this statement, while
allowing Octave to warn about other assignments used in conditional
contexts.

The default value of @code{warn_assign_as_truth_value} is 1.
@end defvr
warn_function_name_clash
-*- texinfo -*-
@defvr {Built-in Variable} warn_function_name_clash
If the value of @code{warn_function_name_clash} is nonzero, a warning is
issued when Octave finds that the name of a function defined in a
function file differs from the name of the file.  (If the names
disagree, the name declared inside the file is ignored.)  If the value
is 0, the warning is omitted.  The default value is 1.
@end defvr
warn_future_time_stamp
-*- texinfo -*-
@defvr {Built-in Variable} warn_future_time_stamp
If the value of this variable is nonzero, Octave will print a warning
if it finds a function file with a time stamp that is in the future.
@end defvr
warn_missing_semicolon
-*- texinfo -*-
@defvr {Built-in Variable} warn_missing_semicolon
If the value of this variable is nonzero, Octave will warn when
statements in function definitions don't end in semicolons.  The default
value is 0.
@end defvr
warn_precedence_change
-*- texinfo -*-
@defvr {Built-in Variable} warn_precedence_change
If the value of this variable is nonzero, Octave will warn about
possible changes in the meaning of some code due to changes in
precedence for some operators.  Precedence changes have typically
been made for Matlab compatibility.  The default value is 1.
@end defvr
warn_variable_switch_label
-*- texinfo -*-
@defvr {Built-in Variable} warn_variable_switch_label
If the value of this variable is nonzero, Octave will print a warning if
a switch label is not a constant or constant expression
@end defvr
pinv
-*- texinfo -*-
@deftypefn {Loadable Function} {} pinv (@var{x}, @var{tol})
Return the pseudoinverse of @var{x}.  Singular values less than
@var{tol} are ignored. 

If the second argument is omitted, it is assumed that

@example
tol = max (size (@var{x})) * sigma_max (@var{x}) * eps,
@end example

@noindent
where @code{sigma_max (@var{x})} is the maximal singular value of @var{x}.
@end deftypefn
disp
-*- texinfo -*-
@deftypefn {Built-in Function} {} disp (@var{x})
Display the value of @var{x}.  For example,

@example
disp ("The value of pi is:"), disp (pi)

     @print{} the value of pi is:
     @print{} 3.1416
@end example

@noindent
Note that the output from @code{disp} always ends with a newline.

If an output value is requested, @code{disp} prints nothing and
returns the formatted output in a string.
@end deftypefn
@seealso{fdisp}
fdisp
-*- texinfo -*-
@deftypefn {Built-in Function} {} fdisp (@var{fid}, @var{x})
Display the value of @var{x} on the stream @var{fid}.  For example,

@example
disp (stdout, "The value of pi is:"), disp (stdout, pi)

     @print{} the value of pi is:
     @print{} 3.1416
@end example

@noindent
Note that the output from @code{disp} always ends with a newline.

If an output value is requested, @code{disp} prints nothing and
returns the formatted output in a string.
@end deftypefn
@seealso{disp}
format
-*- texinfo -*-
@deffn {Command} format options
Control the format of the output produced by @code{disp} and Octave's
normal echoing mechanism.  Valid options are listed in the following
table.

@table @code
@item short
Octave will try to print numbers with at
least 5 significant figures within a field that is a maximum of 10
characters wide (not counting additional spacing that is added between
columns of a matrix).

If Octave is unable to format a matrix so that columns line up on the
decimal point and all the numbers fit within the maximum field width,
it switches to an @samp{e} format.

@item long
Octave will try to print numbers with at least 15 significant figures
within a field that is a maximum of 20 characters wide (not counting
additional spacing that is added between columns of a matrix).

As will the @samp{short} format, Octave will switch to an @samp{e}
format if it is unable to format a matrix so that columns line up on the
decimal point and all the numbers fit within the maximum field width.

@item long e
@itemx short e
The same as @samp{format long} or @samp{format short} but always display
output with an @samp{e} format.  For example, with the @samp{short e}
format, @code{pi} is displayed as @code{3.14e+00}.

@item long E
@itemx short E
The same as @samp{format long e} or @samp{format short e} but always
display output with an uppercase @samp{E} format.  For example, with
the @samp{long E} format, @code{pi} is displayed as
@code{3.14159265358979E+00}.
@item long g
@itemx short g
Choose between normal @samp{long} (or @samp{short}) and and
@samp{long e} (or @samp{short e}) formats based on the magnitude
of the number.  For example, with the @samp{short g} format,
@code{pi .^ [2; 4; 8; 16; 32]} is displayed as

@example
@group
ans =

      3.1416
      9.8696
      97.409
      9488.5
  9.0032e+07
  8.1058e+15
@end group
@end example

@item long G
@itemx short G
The same as @samp{format long g} or @samp{format short g} but use an
uppercase @samp{E} format.  For example, with the @samp{short G} format,
@code{pi .^ [2; 4; 8; 16; 32]} is displayed as

@example
@group
ans =

      3.1416
      9.8696
      97.409
      9488.5
  9.0032E+07
  8.1058E+15
@end group
@end example

@item free
@itemx none
Print output in free format, without trying to line up columns of
matrices on the decimal point.  This also causes complex numbers to be
formatted like this @samp{(0.604194, 0.607088)} instead of like this
@samp{0.60419 + 0.60709i}.

@item bank
Print in a fixed format with two places to the right of the decimal
point.

@item +
@itemx + @var{chars}
@itemx plus
@itemx plus @var{chars}
Print a @samp{+} symbol for nonzero matrix elements and a space for zero
matrix elements.  This format can be very useful for examining the
structure of a large matrix.

The optional argument @var{chars} specifies a list of 3 characters to use
for printing values greater than zero, less than zero and equal to zero.
For example, with the @samp{+ "+-."} format, @code{[1, 0, -1; -1, 0, 1]}
is displayed as

@example
@group
ans =

+.-
-.+
@end group
@end example

@itemx native-hex
Print the hexadecimal representation numbers as they are stored in
memory.  For example, on a workstation which stores 8 byte real values
in IEEE format with the least significant byte first, the value of
@code{pi} when printed in @code{hex} format is @code{400921fb54442d18}.
This format only works for numeric values.

@item hex
The same as @code{native-hex}, but always print the most significant
byte first.
@item native-bit
Print the bit representation of numbers as stored in memory.
For example, the value of @code{pi} is

@example
@group
01000000000010010010000111111011
01010100010001000010110100011000
@end group
@end example

(shown here in two 32 bit sections for typesetting purposes) when
printed in bit format on a workstation which stores 8 byte real values
in IEEE format with the least significant byte first.  This format only
works for numeric types.
@item bit
The same as @code{native-bit}, but always print the most significant
bits first.
@item compact
Remove extra blank space around column number labels.
@item loose
Insert blank lines above and below column number labels (this is the
default).
@end table

By default, Octave will try to print numbers with at least 5 significant
figures within a field that is a maximum of 10 characters wide.

If Octave is unable to format a matrix so that columns line up on the
decimal point and all the numbers fit within the maximum field width,
it switches to an @samp{e} format.

If @code{format} is invoked without any options, the default format
state is restored.
@end deffn
fixed_point_format
-*- texinfo -*-
@defvr {Built-in Variable} fixed_point_format
If the value of this variable is nonzero, Octave will scale all values
in a matrix so that the largest may be written with one leading digit.
The scaling factor is printed on the first line of output.  For example,

@example
@group
octave:1> logspace (1, 7, 5)'
ans =

  1.0e+07  *

  0.00000
  0.00003
  0.00100
  0.03162
  1.00000
@end group
@end example

@noindent
Notice that first value appears to be zero when it is actually 1.  For
this reason, you should be careful when setting
@code{fixed_point_format} to a nonzero value.

The default value of @code{fixed_point_format} is 0.
@end defvr
output_max_field_width
-*- texinfo -*-
@defvr {Built-in Variable} output_max_field_width
This variable specifies the maximum width of a numeric output field.
The default value is 10.
@end defvr
output_precision
-*- texinfo -*-
@defvr {Built-in Variable} output_precision
This variable specifies the minimum number of significant figures to
display for numeric output.  The default value is 5.
@end defvr
print_empty_dimensions
-*- texinfo -*-
@defvr {Built-in Variable} print_empty_dimensions
If the value of @code{print_empty_dimensions} is nonzero, the
dimensions of empty matrices are printed along with the empty matrix
symbol, @samp{[]}.  For example, the expression

@example
zeros (3, 0)
@end example

@noindent
will print

@example
ans = [](3x0)
@end example
@end defvr
split_long_rows
-*- texinfo -*-
@defvr {Built-in Variable} split_long_rows
For large matrices, Octave may not be able to display all the columns of
a given row on one line of your screen.  This can result in missing
information or output that is nearly impossible to decipher, depending
on whether your terminal truncates or wraps long lines.

If the value of @code{split_long_rows} is nonzero, Octave will display
the matrix in a series of smaller pieces, each of which can fit within
the limits of your terminal width.  Each set of rows is labeled so that
you can easily see which columns are currently being displayed.
For example:

@smallexample
@group
octave:13> rand (2,10)
ans =

 Columns 1 through 6:

  0.75883  0.93290  0.40064  0.43818  0.94958  0.16467
  0.75697  0.51942  0.40031  0.61784  0.92309  0.40201

 Columns 7 through 10:

  0.90174  0.11854  0.72313  0.73326
  0.44672  0.94303  0.56564  0.82150
@end group
@end smallexample

@noindent
The default value of @code{split_long_rows} is nonzero.
@end defvr
__end__
internal function
print_rhs_assign_val
-*- texinfo -*-
@defvr print_rhs_assign_val
If the value of this variable is non-zero, Octave will print the value
of the right hand side of assignment expressions instead of the value
of the left hand side (after the assignment).
@end defvr
string_fill_char
-*- texinfo -*-
@defvr {Built-in Variable} string_fill_char
The value of this variable is used to pad all strings in a string matrix
to the same length.  It should be a single character.  The default value
is @code{" "} (a single space).  For example,

@example
@group
string_fill_char = "X";
[ "these"; "are"; "strings" ]
     @result{} "theseXX"
        "areXXXX"
        "strings"
@end group
@end example
@end defvr
warn_empty_list_elements
-*- texinfo -*-
@defvr {Built-in Variable} warn_empty_list_elements
If the value of @code{warn_empty_list_elements} is nonzero, print a
warning when an empty matrix is found in a matrix list.  For example,

@example
a = [1, [], 3, [], 5]
@end example

@noindent
The default value is 0.
@end defvr
warn_undefined_return_values
-*- texinfo -*-
@defvr {Built-in Variable} warn_undefined_return_values
If the value of @code{warn_undefined_return_values} is nonzero,
print a warning if a function does not define all the values in
the return list which are expected.  The default value is 1.
@end defvr
clearplot
-*- texinfo -*-
@deftypefn {Built-in Function} {} clearplot
@deftypefnx {Built-in Function} {} clg
Clear the plot window and any titles or axis labels.  The name
@code{clg} is aliased to @code{clearplot} for compatibility with
@sc{Matlab}.

The commands @kbd{gplot clear}, @kbd{gsplot clear}, and @kbd{replot
clear} are equivalent to @code{clearplot}.  (Previously, commands like
@kbd{gplot clear} would evaluate @code{clear} as an ordinary expression
and clear all the visible variables.)
@end deftypefn
closeplot
-*- texinfo -*-
@deftypefn {Built-in Function} {} closeplot
Close stream to the @code{gnuplot} subprocess.  If you are using X11,
this will close the plot window.
@end deftypefn
hold
-*- texinfo -*-
@deftypefn {Built-in Function} {} hold @var{args}
Tell Octave to `hold' the current data on the plot when executing
subsequent plotting commands.  This allows you to execute a series of
plot commands and have all the lines end up on the same figure.  The
default is for each new plot command to clear the plot device first.
For example, the command

@example
hold on
@end example

@noindent
turns the hold state on.  An argument of @code{off} turns the hold state
off, and @code{hold} with no arguments toggles the current hold state.
@end deftypefn
ishold
-*- texinfo -*-
@deftypefn {Built-in Function} {} ishold
Return 1 if the next line will be added to the current plot, or 0 if
the plot device will be cleared before drawing the next line.
@end deftypefn
purge_tmp_files
-*- texinfo -*-
@deftypefn {Built-in Function} {} purge_tmp_files
Delete the temporary files created by the plotting commands.

Octave creates temporary data files for @code{gnuplot} and then sends
commands to @code{gnuplot} through a pipe.  Octave will delete the
temporary files on exit, but if you are doing a lot of plotting you may
want to clean up in the middle of a session.

A future version of Octave will eliminate the need to use temporary
files to hold the plot data.
@end deftypefn
graw
-*- texinfo -*-
@deftypefn {Built-in Function} {} graw (@var{string})
Send @var{string} directly to gnuplot subprocess.
@end deftypefn
gset
-*- texinfo -*-
@deffn {Command} gset options
Set plotting options for gnuplot
@end deffn
set
-*- texinfo -*-
This command is has been replaced by @code{gset}.
gshow
-*- texinfo -*-
@deffn {Command} gshow options
Show plotting options.
@end deffn
show
-*- texinfo -*-
This command is has been replaced by @code{gshow}.
automatic_replot
-*- texinfo -*-
@defvr {Built-in Variable} automatic_replot
You can tell Octave to redisplay the plot each time anything about it
changes by setting the value of the builtin variable
@code{automatic_replot} to a nonzero value.  Although it is fairly
inefficient, especially for large plots, the default value is 1 for
compatibility with Matlab.
@end defvr
gnuplot_binary
-*- texinfo -*-
@defvr {Built-in Variable} gnuplot_binary
The name of the program invoked by the plot command.  The default value
is @code{"gnuplot"}.  @xref{Installation}.
@end defvr
gnuplot_command_plot
-*- texinfo -*-
@defvr {Built-in Variable} gnuplot_command_plot
@end defvr
gnuplot_command_replot
-*- texinfo -*-
@defvr {Built-in Variable} gnuplot_command_replot
@end defvr
gnuplot_command_splot
-*- texinfo -*-
@defvr {Built-in Variable} gnuplot_command_splot
@end defvr
gnuplot_command_using
-*- texinfo -*-
@defvr {Built-in Variable} gnuplot_command_using
@end defvr
gnuplot_command_with
-*- texinfo -*-
@defvr {Built-in Variable} gnuplot_command_with
@end defvr
gnuplot_command_axes
-*- texinfo -*-
@defvr {Built-in Variable} gnuplot_command_axes
@end defvr
gnuplot_command_title
-*- texinfo -*-
@defvr {Built-in Variable} gnuplot_command_title
@end defvr
gnuplot_command_end
-*- texinfo -*-
@defvr {Built-in Variable} gnuplot_command_end
@end defvr
gnuplot_has_frames
-*- texinfo -*-
@defvr {Built-in Variable} gnuplot_has_frames
If the value of this variable is nonzero, Octave assumes that your copy
of gnuplot has support for multiple frames that is included in recent
3.6beta releases.  It's initial value is determined by configure, but it
can be changed in your startup script or at the command line in case
configure got it wrong, or if you upgrade your gnuplot installation.
@end defvr
qr
-*- texinfo -*-
@deftypefn {Loadable Function} {[@var{q}, @var{r}, @var{p}] =} qr (@var{a})
@cindex QR factorization
Compute the QR factorization of @var{a}, using standard @sc{Lapack}
subroutines.  For example, given the matrix @code{a = [1, 2; 3, 4]},

@example
[q, r] = qr (a)
@end example

@noindent
returns

@example
q =

  -0.31623  -0.94868
  -0.94868   0.31623

r =

  -3.16228  -4.42719
   0.00000  -0.63246
@end example

The @code{qr} factorization has applications in the solution of least
squares problems
@iftex
@tex
$$
\min_x \left\Vert A x - b \right\Vert_2
$$
@end tex
@end iftex
@ifinfo

@example
@code{min norm(A x - b)}
@end example

@end ifinfo
for overdetermined systems of equations (i.e.,
@iftex
@tex
$A$
@end tex
@end iftex
@ifinfo
@code{a}
@end ifinfo
 is a tall, thin matrix).  The QR factorization is
@iftex
@tex
$QR = A$ where $Q$ is an orthogonal matrix and $R$ is upper triangular.
@end tex
@end iftex
@ifinfo
@code{q * r = a} where @code{q} is an orthogonal matrix and @code{r} is
upper triangular.
@end ifinfo

The permuted QR factorization @code{[@var{q}, @var{r}, @var{p}] =
qr (@var{a})} forms the QR factorization such that the diagonal
entries of @code{r} are decreasing in magnitude order.  For example,
given the matrix @code{a = [1, 2; 3, 4]},

@example
[q, r, p] = qr(a)
@end example

@noindent
returns

@example
q = 

  -0.44721  -0.89443
  -0.89443   0.44721

r =

  -4.47214  -3.13050
   0.00000   0.44721

p =

   0  1
   1  0
@end example

The permuted @code{qr} factorization @code{[q, r, p] = qr (a)}
factorization allows the construction of an orthogonal basis of
@code{span (a)}.
@end deftypefn
quad_options
-*- texinfo -*-
@deftypefn {Loadable Function} {} quad_options (@var{opt}, @var{val})
When called with two arguments, this function
allows you set options parameters for the function @code{quad}.
Given one argument, @code{quad_options} returns the value of the
corresponding option.  If no arguments are supplied, the names of all
the available options and their current values are displayed.

Options include

@table @code
@item "absolute tolerance"
Absolute tolerance; may be zero for pure relative error test.
@item "relative tolerance"
Nonnegative relative tolerance.  If the absolute tolerance is zero,
the relative tolerance must be greater than or equal to 
@code{max (50*eps, 0.5e-28)}.
@end table
@end deftypefn
quad
-*- texinfo -*-
@deftypefn {Loadable Function} {[@var{v}, @var{ier}, @var{nfun}, @var{err}] =} quad (@var{f}, @var{a}, @var{b}, @var{tol}, @var{sing})
Integrate a nonlinear function of one variable using Quadpack.
The first argument is the name of the  function to call to compute the
value of the integrand.  It must have the form

@example
y = f (x)
@end example

@noindent
where @var{y} and @var{x} are scalars.

The second and third arguments are limits of integration.  Either or
both may be infinite.

The optional argument @var{tol} is a vector that specifies the desired
accuracy of the result.  The first element of the vector is the desired
absolute tolerance, and the second element is the desired relative
tolerance.  To choose a relative test only, set the absolute
tolerance to zero.  To choose an absolute test only, set the relative
tolerance to zero. 

The optional argument @var{sing} is a vector of values at which the
integrand is known to be singular.

The result of the integration is returned in @var{v} and @var{ier}
contains an integer error code (0 indicates a successful integration).
The value of @var{nfun} indicates how many function evaluations were
required, and @var{err} contains an estimate of the error in the
solution.

You can use the function @code{quad_options} to set optional
parameters for @code{quad}.
@end deftypefn
qz
-*- texinfo -*-
@deftypefn {Loadable Function} {@var{lambda} =} qz (@var{a}, @var{b})
Generalized eigenvalue problem @math{A x = s B x},
@var{QZ} decomposition.  Three ways to call:
@enumerate
@item @code{lambda = qz(A,B)}

Computes the generalized eigenvalues @var{lambda} of @math{(A - sB)}.

@item @code{[AA, BB, Q, Z, V, W, lambda] = qz (A, B)}

Computes qz decomposition, generalized eigenvectors, and 
        generalized eigenvalues of @math{(A - sB)}
@example
@group
        A V = B V diag(lambda)
        W' A = diag(lambda) W' B
        AA = Q'*A*Z, BB = Q'*B*Z  with Q, Z orthogonal (unitary)= I
@end group
@end example

@item @code{[AA,BB,Z@{,lambda@}] = qz(A,B,opt)}

As in form [2], but allows ordering of generalized eigenpairs
        for (e.g.) solution of discrete time algebraic Riccati equations.
        Form 3 is not available for complex matrices and does not compute
        the generalized eigenvectors V, W, nor the orthogonal matrix Q.
@table @var
@item opt
 for ordering eigenvalues of the GEP pencil.  The leading  block
             of the revised pencil contains all eigenvalues that satisfy:
@table @code
@item "N"
 = unordered (default) 

@item "S"
= small: leading block has all |lambda| <=1 

@item "B"
 = big: leading block has all |lambda >= 1 

@item "-"
 = negative real part: leading  block has all eigenvalues
                  in the open left half-plant

@item "+"
 = nonnegative real part:  leading block has all eigenvalues
                  in the closed right half-plane
@end  table
@end table
@end enumerate

Note: qz performs permutation balancing, but not scaling (see balance).
      Order of output arguments was selected for compatibility with MATLAB

See also: balance, dare, eig, schur
@end deftypefn
rand
-*- texinfo -*-
@deftypefn {Loadable Function} {} rand (@var{x})
@deftypefnx {Loadable Function} {} rand (@var{n}, @var{m})
@deftypefnx {Loadable Function} {} rand (@code{"seed"}, @var{x})
Return a matrix with random elements uniformly distributed on the
interval (0, 1).  The arguments are handled the same as the arguments
for @code{eye}.  In
addition, you can set the seed for the random number generator using the
form

@example
rand ("seed", @var{x})
@end example

@noindent
where @var{x} is a scalar value.  If called as

@example
rand ("seed")
@end example

@noindent
@code{rand} returns the current value of the seed.
@end deftypefn
randn
-*- texinfo -*-
@deftypefn {Loadable Function} {} randn (@var{x})
@deftypefnx {Loadable Function} {} randn (@var{n}, @var{m})
@deftypefnx {Loadable Function} {} randn (@code{"seed"}, @var{x})
Return a matrix with normally distributed random elements.  The
arguments are handled the same as the arguments for @code{eye}.  In
addition, you can set the seed for the random number generator using the
form

@example
randn ("seed", @var{x})
@end example

@noindent
where @var{x} is a scalar value.  If called as

@example
randn ("seed")
@end example

@noindent
@code{randn} returns the current value of the seed.
@end deftypefn
schur
-*- texinfo -*-
@deftypefn {Loadable Function} {@var{s} =} schur (@var{a})
@deftypefnx {Loadable Function} {[@var{u}, @var{s}] =} schur (@var{a}, @var{opt})
@cindex Schur decomposition
The Schur decomposition is used to compute eigenvalues of a
square matrix, and has applications in the solution of algebraic
Riccati equations in control (see @code{are} and @code{dare}).
@code{schur} always returns
@iftex
@tex
$S = U^T A U$
@end tex
@end iftex
@ifinfo
@code{s = u' * a * u}
@end ifinfo
where
@iftex
@tex
$U$
@end tex
@end iftex
@ifinfo
@code{u}
@end ifinfo
 is a unitary matrix
@iftex
@tex
($U^T U$ is identity)
@end tex
@end iftex
@ifinfo
(@code{u'* u} is identity)
@end ifinfo
and
@iftex
@tex
$S$
@end tex
@end iftex
@ifinfo
@code{s}
@end ifinfo
is upper triangular.  The eigenvalues of
@iftex
@tex
$A$ (and $S$)
@end tex
@end iftex
@ifinfo
@code{a} (and @code{s})
@end ifinfo
are the diagonal elements of
@iftex
@tex
$S$
@end tex
@end iftex
@ifinfo
@code{s}
@end ifinfo
If the matrix
@iftex
@tex
$A$
@end tex
@end iftex
@ifinfo
@code{a}
@end ifinfo
is real, then the real Schur decomposition is computed, in which the
matrix
@iftex
@tex
$U$
@end tex
@end iftex
@ifinfo
@code{u}
@end ifinfo
is orthogonal and
@iftex
@tex
$S$
@end tex
@end iftex
@ifinfo
@code{s}
@end ifinfo
is block upper triangular
with blocks of size at most
@iftex
@tex
$2\times 2$
@end tex
@end iftex
@ifinfo
@code{2 x 2}
@end ifinfo
along the diagonal.  The diagonal elements of
@iftex
@tex
$S$
@end tex
@end iftex
@ifinfo
@code{s}
@end ifinfo
(or the eigenvalues of the
@iftex
@tex
$2\times 2$
@end tex
@end iftex
@ifinfo
@code{2 x 2}
@end ifinfo
blocks, when
appropriate) are the eigenvalues of
@iftex
@tex
$A$
@end tex
@end iftex
@ifinfo
@code{a}
@end ifinfo
and
@iftex
@tex
$S$.
@end tex
@end iftex
@ifinfo
@code{s}.
@end ifinfo

The eigenvalues are optionally ordered along the diagonal according to
the value of @code{opt}.  @code{opt = "a"} indicates that all
eigenvalues with negative real parts should be moved to the leading
block of
@iftex
@tex
$S$
@end tex
@end iftex
@ifinfo
@code{s}
@end ifinfo
(used in @code{are}), @code{opt = "d"} indicates that all eigenvalues
with magnitude less than one should be moved to the leading block of
@iftex
@tex
$S$
@end tex
@end iftex
@ifinfo
@code{s}
@end ifinfo
(used in @code{dare}), and @code{opt = "u"}, the default, indicates that
no ordering of eigenvalues should occur.  The leading
@iftex
@tex
$k$
@end tex
@end iftex
@ifinfo
@code{k}
@end ifinfo
columns of
@iftex
@tex
$U$
@end tex
@end iftex
@ifinfo
@code{u}
@end ifinfo
always span the
@iftex
@tex
$A$-invariant
@end tex
@end iftex
@ifinfo
@code{a}-invariant
@end ifinfo
subspace corresponding to the
@iftex
@tex
$k$
@end tex
@end iftex
@ifinfo
@code{k}
@end ifinfo
leading eigenvalues of
@iftex
@tex
$S$.
@end tex
@end iftex
@ifinfo
@code{s}.
@end ifinfo
@end deftypefn
debug_on_interrupt
-*- texinfo -*-
@defvr {Built-in Variable} debug_on_interrupt
If @code{debug_on_interrupt} is nonzero, Octave will try to enter
debugging mode when it receives an interrupt signal (typically
generated with @kbd{C-c}).  If a second interrupt signal is received
before reaching the debugging mode, a normal interrupt will occur.
The default value is 0.
@end defvr
sighup_dumps_octave_core
-*- texinfo -*-
@defvr {Built-in Variable} sighup_dumps_octave_core
If this variable is set to a nonzero value and
@code{crash_dumps_octave_core} is also nonzero, Octave tries to save all
current variables the the file "octave-core" if it receives a
hangup signal.  The default value is 1.
@end defvr
sigterm_dumps_octave_core
-*- texinfo -*-
@defvr {Built-in Variable} sigterm_dumps_octave_core
If this variable is set to a nonzero value and
@code{crash_dumps_octave_core} is also nonzero, Octave tries to save all
current variables the the file "octave-core" if it receives a
terminate signal.  The default value is 1.
@end defvr
SIG
-*- texinfo -*-
@defvr {Built-in Variable} SIG
Structure of Unix signal names and their defined values.
@end defvr
sort
-*- texinfo -*-
@deftypefn {Loadable Function} {[@var{s}, @var{i}] =} sort (@var{x})
Return a copy of @var{x} with the elements elements arranged in
increasing order.  For matrices, @code{sort} orders the elements in each
column.

For example,

@example
@group
sort ([1, 2; 2, 3; 3, 1])
     @result{}  1  1
         2  2
         3  3
@end group
@end example

The @code{sort} function may also be used to produce a matrix
containing the original row indices of the elements in the sorted
matrix.  For example,

@example
@group
[s, i] = sort ([1, 2; 2, 3; 3, 1])
     @result{} s = 1  1
            2  2
            3  3
     @result{} i = 1  3
            2  1
            3  2
@end group
@end example
@end deftypefn
sqrtm
-*- texinfo -*-
@deftypefn {Loadable Function} {[@var{result}, @var{error_estimate}] =} sqrtm (@var{a})
Compute the matrix square root of the square matrix @var{a}.

Ref: Nicholas J. Higham. A new sqrtm for MATLAB. Numerical Analysis
Report No. 336, Manchester Centre for Computational Mathematics,
Manchester, England, January 1999.
@end deftypefn
@seealso{expm, logm, and funm}
char
-*- texinfo -*-
@deftypefn {Built-in Function} {} char (@var{x})
@deftypefnx {Built-in Function} {} char (@var{cell_array})
@deftypefnx {Built-in Function} {} char (@var{s1}, @var{s2}, @dots{})
Create a string array from a numeric matrix, cell array, or list of

If the argument is a numeric matrix, each element of the matrix is
converted to the corresponding ASCII character.  For example,

@example
@group
char ([97, 98, 99])
     @result{} "abc"
@end group
@end example

If the argument is a cell array of strings, the result is a string array
with each element corresponding to one element of the cell array.

For multiple string arguments, the result is a string array with each
element corresponding to the arguments.

The returned values are padded with blanks as needed to make each row
of the string array have the same length.
@end deftypefn
ischar
-*- texinfo -*-
@deftypefn {Built-in Function} {} ischar (@var{a})
Return 1 if @var{a} is a string.  Otherwise, return 0.
@end deftypefn
svd
-*- texinfo -*-
@deftypefn {Loadable Function} {@var{s} =} svd (@var{a})
@deftypefnx {Loadable Function} {[@var{u}, @var{s}, @var{v}] =} svd (@var{a})
@cindex singular value decomposition
Compute the singular value decomposition of @var{a}
@iftex
@tex
$$
 A = U\Sigma V^H
$$
@end tex
@end iftex
@ifinfo

@example
a = u * sigma * v'
@end example
@end ifinfo

The function @code{svd} normally returns the vector of singular values.
If asked for three return values, it computes
@iftex
@tex
$U$, $S$, and $V$.
@end tex
@end iftex
@ifinfo
U, S, and V.
@end ifinfo
For example,

@example
svd (hilb (3))
@end example

@noindent
returns

@example
ans =

  1.4083189
  0.1223271
  0.0026873
@end example

@noindent
and

@example
[u, s, v] = svd (hilb (3))
@end example

@noindent
returns

@example
u =

  -0.82704   0.54745   0.12766
  -0.45986  -0.52829  -0.71375
  -0.32330  -0.64901   0.68867

s =

  1.40832  0.00000  0.00000
  0.00000  0.12233  0.00000
  0.00000  0.00000  0.00269

v =

  -0.82704   0.54745   0.12766
  -0.45986  -0.52829  -0.71375
  -0.32330  -0.64901   0.68867
@end example

If given a second argument, @code{svd} returns an economy-sized
decomposition, eliminating the unnecessary rows or columns of @var{u} or
@var{v}.
@end deftypefn
syl
-*- texinfo -*-
@deftypefn {Loadable Function} {@var{x} =} syl (@var{a}, @var{b}, @var{c})
Solve the Sylvester equation
@iftex
@tex
$$
 A X + X B + C = 0
$$
@end tex
@end iftex
@ifinfo

@example
A X + X B + C = 0
@end example
@end ifinfo
using standard @sc{Lapack} subroutines.  For example,

@example
@group
syl ([1, 2; 3, 4], [5, 6; 7, 8], [9, 10; 11, 12])
     @result{} [ -0.50000, -0.66667; -0.66667, -0.50000 ]
@end group
@end example
@end deftypefn
variables_can_hide_functions
-*- texinfo -*-
@defvr variables_can_hide_functions
If the value of this variable is nonzero, assignments to variables may
hide previously defined functions of the same name.  A negative value
will cause Octave to print a warning, but allow the operation.
@end defvr
debug_symtab_lookups
-*- texinfo -*-
@defvr debug_symtab_lookups
If the value of htis variable is nonzero, print debugging info when
searching for symbols in the symbol tables
dup2
-*- texinfo -*-
@deftypefn {Built-in Function} {[@var{fid}, @var{msg}] =} dup2 (@var{old}, @var{new})
Duplicate a file descriptor.

If successful, @var{fid} is greater than zero and contains the new file
ID.  Otherwise, @var{fid} is negative and @var{msg} contains a
system-dependent error message.
@end deftypefn
exec
-*- texinfo -*-
@deftypefn {Built-in Function} {[@var{err}, @var{msg}] =} exec (@var{file}, @var{args})
Replace current process with a new process.  Calling @code{exec} without
first calling @code{fork} will terminate your current Octave process and
replace it with the program named by @var{file}.  For example,

@example
exec ("ls" "-l")
@end example

@noindent
will run @code{ls} and return you to your shell prompt.

If successful, @code{exec} does not return.  If @code{exec} does return,
@var{err} will be nonzero, and @var{msg} will contain a system-dependent
error message.
@end deftypefn
fcntl
-*- texinfo -*-
@deftypefn {Built-in Function} {[@var{err}, @var{msg}] =} fcntl (@var{fid}, @var{request}, @var{arg})
Change the properties of the open file @var{fid}.  The following values
may be passed as @var{request}:

@vtable @code
@item F_DUPFD
Return a duplicate file descriptor.

@item F_GETFD
Return the file descriptor flags for @var{fid}.

@item F_SETFD
Set the file descriptor flags for @var{fid}.

@item F_GETFL
Return the file status flags for @var{fid}.  The following codes may be
returned (some of the flags may be undefined on some systems).

@vtable @code
@item O_RDONLY
Open for reading only.

@item O_WRONLY
Open for writing only.

@item O_RDWR
Open for reading and writing.

@item O_APPEND
Append on each write.

@item O_NONBLOCK
Nonblocking mode.

@item O_SYNC
Wait for writes to complete.

@item O_ASYNC
Asynchronous I/O.
@end vtable

@item F_SETFL
Set the file status flags for @var{fid} to the value specified by
@var{arg}.  The only flags that can be changed are @code{O_APPEND} and
@code{O_NONBLOCK}.
@end vtable

If successful, @var{err} is 0 and @var{msg} is an empty string.
Otherwise, @var{err} is nonzero and @var{msg} contains a
system-dependent error message.
@end deftypefn
fork
-*- texinfo -*-
@deftypefn {Built-in Function} {[@var{pid}, @var{msg}] =} fork ()
Create a copy of the current process.

Fork can return one of the following values:

@table @asis
@item > 0
You are in the parent process.  The value returned from @code{fork} is
the process id of the child process.  You should probably arrange to
wait for any child processes to exit.

@item 0
You are in the child process.  You can call @code{exec} to start another
process.  If that fails, you should probably call @code{exit}.

@item < 0
The call to @code{fork} failed for some reason.  You must take evasive
action.  A system dependent error message will be waiting in @var{msg}.
@end table
@end deftypefn
getpgrp
-*- texinfo -*-
@deftypefn {Built-in Function} {pgid =} getpgrp ()
Return the process group id of the current process.
@end deftypefn
getpid
-*- texinfo -*-
@deftypefn {Built-in Function} {pid =} getpid ()
Return the process id of the current process.
@end deftypefn
getppid
-*- texinfo -*-
@deftypefn {Built-in Function} {pid =} getppid ()
Return the process id of the parent process.
@end deftypefn
getegid
-*- texinfo -*-
@deftypefn {Built-in Function} {egid =} getegid ()
Return the effective group id of the current process.
@end deftypefn
getgid
-*- texinfo -*-
@deftypefn {Built-in Function} {gid =} getgid ()
Return the real group id of the current process.
@end deftypefn
geteuid
-*- texinfo -*-
@deftypefn {Built-in Function} {euid =} geteuid ()
Return the effective user id of the current process.
@end deftypefn
getuid
-*- texinfo -*-
@deftypefn {Built-in Function} {uid =} getuid ()
Return the real user id of the current process.
@end deftypefn
kill
-*- texinfo -*-
@deftypefn {Built-in Function} {[@var{err}, @var{msg}] =} kill (@var{pid}, @var{sig})
Send signal @var{sig} to process @var{pid}.

If @var{pid} is positive, then signal @var{sig} is sent to @var{pid}.

If @var{pid} is 0, then signal @var{sig} is sent to every process
in the process group of the current process.

If @var{pid} is -1, then signal @var{sig} is sent to every process
except process 1.

If @var{pid} is less than -1, then signal @var{sig} is sent to every
process in the process group @var{-pid}.

If @var{sig} is 0, then no signal is sent, but error checking is still
performed.

Return 0 if sucessful, otherwise return -1.
@end deftypefn
lstat
-*- texinfo -*-
@deftypefn {Built-in Function} {[@var{info}, @var{err}, @var{msg}] =} lstat (@var{file})
See stat.
@end deftypefn
mkfifo
-*- texinfo -*-
@deftypefn {Built-in Function} {[@var{err}, @var{msg}] =} mkfifo (@var{name}, @var{mode})
Create a @var{fifo} special file named @var{name} with file mode @var{mode}
\n
If successful, @var{err} is 0 and @var{msg} is an empty string.
Otherwise, @var{err} is nonzero and @var{msg} contains a
system-dependent error message.
@end deftypefn
pipe
-*- texinfo -*-
@deftypefn {Built-in Function} {[@var{file_ids}, @var{err}, @var{msg}] =} pipe ()
Create a pipe and return the vector @var{file_ids}, which corresponding
to the reading and writing ends of the pipe.

If successful, @var{err} is 0 and @var{msg} is an empty string.
Otherwise, @var{err} is nonzero and @var{msg} contains a
system-dependent error message.
@end deftypefn
stat
-*- texinfo -*-
@deftypefn {Built-in Function} {[@var{info}, @var{err}, @var{msg}] =} stat (@var{file})
@deftypefnx {Built-in Function} {[@var{info}, @var{err}, @var{msg}] =} lstat (@var{file})
Return a structure @var{s} containing the following information about
@var{file}.

@table @code
@item dev
ID of device containing a directory entry for this file.

@item ino
File number of the file.

@item modestr
File mode, as a string of ten letters or dashes as would be returned by
@kbd{ls -l}.

@item nlink
Number of links.

@item uid
User ID of file's owner.

@item gid
Group ID of file's group.

@item rdev
ID of device for block or character special files.

@item size
Size in bytes.

@item atime
Time of last access in the same form as time values returned from
@code{time}.  @xref{Timing Utilities}.

@item mtime
Time of last modification in the same form as time values returned from
@code{time}.  @xref{Timing Utilities}.

@item ctime
Time of last file status change in the same form as time values
returned from @code{time}.  @xref{Timing Utilities}.

@item blksize
Size of blocks in the file.

@item blocks
Number of blocks allocated for file.
@end table

If the call is successful @var{err} is 0 and @var{msg} is an empty
string.  If the file does not exist, or some other error occurs, @var{s}
is an empty matrix, @var{err} is @minus{}1, and @var{msg} contains the
corresponding system error message.

If @var{file} is a symbolic link, @code{stat} will return information
about the actual file the is referenced by the link.  Use @code{lstat}
if you want information about the symbolic link itself.

For example,

@example
@group
[s, err, msg] = stat ("/vmlinuz")
      @result{} s =
        @{
          atime = 855399756
          rdev = 0
          ctime = 847219094
          uid = 0
          size = 389218
          blksize = 4096
          mtime = 847219094
          gid = 6
          nlink = 1
          blocks = 768
          modestr = -rw-r--r--
          ino = 9316
          dev = 2049
        @}
     @result{} err = 0
     @result{} msg = 
@end group
@end example
@end deftypefn
unlink
-*- texinfo -*-
@deftypefn {Built-in Function} {[@var{err}, @var{msg}] =} unlink (@var{file})
Delete the file named @var{file}.

If successful, @var{err} is 0 and @var{msg} is an empty string.
Otherwise, @var{err} is nonzero and @var{msg} contains a
system-dependent error message.
@end deftypefn
waitpid
-*- texinfo -*-
@deftypefn {Built-in Function} {[@var{pid}, @var{msg}] =} waitpid (@var{pid}, @var{options})
Wait for process @var{pid} to terminate.  The @var{pid} argument can be:

@table @asis
@item @minus{}1
Wait for any child process.

@item 0
Wait for any child process whose process group ID is equal to that of
the Octave interpreter process.

@item > 0
Wait for termination of the child process with ID @var{pid}.
@end table

The @var{options} argument can be:

@table @asis
@item 0
Wait until signal is received or a child process exits (this is the
default if the @var{options} argument is missing).

@item 1
Do not hang if status is not immediately available.

@item 2
Report the status of any child processes that are stopped, and whose
status has not yet been reported since they stopped.

@item 3
Implies both 1 and 2.
@end table

If the returned value of @var{pid} is greater than 0, it is the process
ID of the child process that exited.  If an error occurs, @var{pid} will
be less than zero and @var{msg} will contain a system-dependent error
message.
@end deftypefn
F_DUPFD
-*- texinfo -*-
@defvr {Built-in Variable} F_DUPFD
@end defvr
F_GETFD
-*- texinfo -*-
@defvr {Built-in Variable} F_GETFD
@end defvr
F_GETFL
-*- texinfo -*-
@defvr {Built-in Variable} F_GETFL
@end defvr
F_SETFD
-*- texinfo -*-
@defvr {Built-in Variable} F_SETFD
@end defvr
F_SETFL
-*- texinfo -*-
@defvr {Built-in Variable} F_SETFL
@end defvr
O_APPEND
-*- texinfo -*-
@defvr {Built-in Variable} O_APPEND
@end defvr
O_ASYNC
-*- texinfo -*-
@defvr {Built-in Variable} O_ASYNC
@end defvr
O_CREAT
-*- texinfo -*-
@defvr {Built-in Variable} O_CREAT
@end defvr
O_EXCL
-*- texinfo -*-
@defvr {Built-in Variable} O_EXCL
@end defvr
O_NONBLOCK
-*- texinfo -*-
@defvr {Built-in Variable} O_NONBLOCK
@end defvr
O_RDONLY
-*- texinfo -*-
@defvr {Built-in Variable} O_RDONLY
@end defvr
O_RDWR
-*- texinfo -*-
@defvr {Built-in Variable} O_RDWR
@end defvr
O_SYNC
-*- texinfo -*-
@defvr {Built-in Variable} O_SYNC
@end defvr
O_TRUNC
-*- texinfo -*-
@defvr {Built-in Variable} O_TRUNC
@end defvr
O_WRONLY
-*- texinfo -*-
@defvr {Built-in Variable} O_WRONLY
@end defvr
clc
-*- texinfo -*-
@deftypefn {Built-in Function} {} clc ()
@deftypefnx {Built-in Function} {} home ()
Clear the terminal screen and move the cursor to the upper left corner.
@end deftypefn
getenv
-*- texinfo -*-
@deftypefn {Built-in Function} {} getenv (@var{var})
Return the value of the environment variable @var{var}.  For example,

@example
getenv ("PATH")
@end example

@noindent
returns a string containing the value of your path.
@end deftypefn
putenv
-*- texinfo -*-
@deftypefn {Built-in Function} {} putenv (@var{var}, @var{value})
Set the value of the environment variable @var{var} to @var{value}.
@end deftypefn
kbhit
-*- texinfo -*-
@deftypefn {Built-in Function} {} kbhit ()
Read a single keystroke from the keyboard. If called with one
argument, don't wait for a keypress.  For example,

@example
x = kbhit ();
@end example

@noindent
will set @var{x} to the next character typed at the keyboard as soon as
it is typed.

@example
x = kbhit (1);
@end example

@noindent
identical to the above example, but don't wait for a keypress,
returning the empty string if no key is available.
@end deftypefn
pause
-*- texinfo -*-
@deftypefn {Built-in Function} {} pause (@var{seconds})
Suspend the execution of the program.  If invoked without any arguments,
Octave waits until you type a character.  With a numeric argument, it
pauses for the given number of seconds.  For example, the following
statement prints a message and then waits 5 seconds before clearing the
screen.

@example
@group
fprintf (stderr, "wait please...
");
pause (5);
clc;
@end group
@end example
@end deftypefn
sleep
-*- texinfo -*-
@deftypefn {Built-in Function} {} sleep (@var{seconds})
Suspend the execution of the program for the given number of seconds.
@end deftypefn
usleep
-*- texinfo -*-
@deftypefn {Built-in Function} {} usleep (@var{microseconds})
Suspend the execution of the program for the given number of
microseconds.  On systems where it is not possible to sleep for periods
of time less than one second, @code{usleep} will pause the execution for
@code{round (@var{microseconds} / 1e6)} seconds.
@end deftypefn
isieee
-*- texinfo -*-
@deftypefn {Built-in Function} {} isieee ()
Return 1 if your computer claims to conform to the IEEE standard for
floating point calculations.
@end deftypefn
native_float_format
-*- texinfo -*-
@deftypefn {Built-in Function} {} native_float_format ()
Return the native floating point format as a string
@end deftypefn
tilde_expand
-*- texinfo -*-
@deftypefn {Built-in Function} {} tilde_expand (@var{string})
Performs tilde expansion on @var{string}.  If @var{string} begins with a
tilde character, (@samp{~}), all of the characters preceding the first
slash (or all characters, if there is no slash) are treated as a
possible user name, and the tilde and the following characters up to the
slash are replaced by the home directory of the named user.  If the
tilde is followed immediately by a slash, the tilde is replaced by the
home directory of the user running Octave.  For example,

@example
@group
tilde_expand ("~joeuser/bin")
     @result{} "/home/joeuser/bin"
tilde_expand ("~/bin")
     @result{} "/home/jwe/bin"
@end group
@end example
@end deftypefn
time
-*- texinfo -*-
@deftypefn {Loadable Function} {} time ()
Return the current time as the number of seconds since the epoch.  The
epoch is referenced to 00:00:00 CUT (Coordinated Universal Time) 1 Jan
1970.  For example, on Monday February 17, 1997 at 07:15:06 CUT, the
value returned by @code{time} was 856163706.
@end deftypefn
gmtime
-*- texinfo -*-
@deftypefn {Loadable Function} {} gmtime (@var{t})
Given a value returned from time (or any nonnegative integer),
return a time structure corresponding to CUT.  For example,

@example
@group
gmtime (time ())
     @result{} @{
           usec = 0
           year = 97
           mon = 1
           mday = 17
           sec = 6
           zone = CST
           min = 15
           wday = 1
           hour = 7
           isdst = 0
           yday = 47
         @}
@end group
@end example
@end deftypefn
localtime
-*- texinfo -*-
@deftypefn {Loadable Function} {} localtime (@var{t})
Given a value returned from time (or any nonnegative integer),
return a time structure corresponding to the local time zone.

@example
@group
localtime (time ())
     @result{} @{
           usec = 0
           year = 97
           mon = 1
           mday = 17
           sec = 6
           zone = CST
           min = 15
           wday = 1
           hour = 1
           isdst = 0
           yday = 47
         @}
@end group
@end example
@end deftypefn
mktime
-*- texinfo -*-
@deftypefn {Loadable Function} {} mktime (@var{tm_struct})
Convert a time structure corresponding to the local time to the number
of seconds since the epoch.  For example,

@example
@group
mktime (localtime (time ())
     @result{} 856163706
@end group
@end example
@end deftypefn
strftime
-*- texinfo -*-
@deftypefn {Loadable Function} {} strftime (@var{tm_struct})
Format a time structure in a flexible way using @samp{%} substitutions
similar to those in @code{printf}.  Except where noted, substituted
fields have a fixed size; numeric fields are padded if necessary.
Padding is with zeros by default; for fields that display a single
number, padding can be changed or inhibited by following the @samp{%}
with one of the modifiers described below.  Unknown field specifiers are
copied as normal characters.  All other characters are copied to the
output without change.  For example,

@example
@group
strftime ("%r (%Z) %A %e %B %Y", localtime (time ())
     @result{} "01:15:06 AM (CST) Monday 17 February 1997"
@end group
@end example

Octave's @code{strftime} function supports a superset of the ANSI C
field specifiers.

@noindent
Literal character fields:

@table @code
@item %
% character.

@item n
Newline character.

@item t
Tab character.
@end table

@noindent
Numeric modifiers (a nonstandard extension):

@table @code
@item - (dash)
Do not pad the field.

@item _ (underscore)
Pad the field with spaces.
@end table

@noindent
Time fields:

@table @code
@item %H
Hour (00-23).

@item %I
Hour (01-12).

@item %k
Hour (0-23).

@item %l
Hour (1-12).

@item %M
Minute (00-59).

@item %p
Locale's AM or PM.

@item %r
Time, 12-hour (hh:mm:ss [AP]M).

@item %R
Time, 24-hour (hh:mm).

@item %s
Time in seconds since 00:00:00, Jan 1, 1970 (a nonstandard extension).

@item %S
Second (00-61).

@item %T
Time, 24-hour (hh:mm:ss).

@item %X
Locale's time representation (%H:%M:%S).

@item %Z
Time zone (EDT), or nothing if no time zone is determinable.
@end table

@noindent
Date fields:

@table @code
@item %a
Locale's abbreviated weekday name (Sun-Sat).

@item %A
Locale's full weekday name, variable length (Sunday-Saturday).

@item %b
Locale's abbreviated month name (Jan-Dec).

@item %B
Locale's full month name, variable length (January-December).

@item %c
Locale's date and time (Sat Nov 04 12:02:33 EST 1989).

@item %C
Century (00-99).

@item %d
Day of month (01-31).

@item %e
Day of month ( 1-31).

@item %D
Date (mm/dd/yy).

@item %h
Same as %b.

@item %j
Day of year (001-366).

@item %m
Month (01-12).

@item %U
Week number of year with Sunday as first day of week (00-53).

@item %w
Day of week (0-6).

@item %W
Week number of year with Monday as first day of week (00-53).

@item %x
Locale's date representation (mm/dd/yy).

@item %y
Last two digits of year (00-99).

@item %Y
Year (1970-).
@end table
@end deftypefn

strptime
-*- texinfo -*-
@deftypefn {Loadable Function} {[@var{tm_struct}, @var{nchars}] =} strptime (@var{str}, @var{fmt})
Convert the string @var{str} to a time structure under the control of
the format @var{fmt}.
@end deftypefn
casesen
-*- texinfo -*-
@deffn {Command} casesen arg
Provided for compatibility with Matlab, but does nothing.
@end deffn
quit
-*- texinfo -*-
@deftypefn {Built-in Function} {} exit (@var{status})
@deftypefnx {Built-in Function} {} quit (@var{status})
Exit the current Octave session.  If the optional integer value
@var{status} is supplied, pass that value to the operating system as the
Octave's exit status.
@end deftypefn
warranty
-*- texinfo -*-
@deftypefn {Built-in Function} {} warranty ()
Describe the conditions for copying and distributing Octave.
@end deftypefn
system
-*- texinfo -*-
@deftypefn {Built-in Function} {} system (@var{string}, @var{return_output}, @var{type})
Execute a shell command specified by @var{string}.  The second
argument is optional.  If @var{type} is @code{"async"}, the process
is started in the background and the process id of the child process
is returned immediately.  Otherwise, the process is started, and
Octave waits until it exits.  If @var{type} argument is omitted, a
value of @code{"sync"} is assumed.

If two input arguments are given (the actual value of
@var{return_output} is irrelevant) and the subprocess is started
synchronously, or if @var{system} is called with one input argument and
one or more output arguments, the output from the command is returned.
Otherwise, if the subprocess is executed synchronously, it's output is
sent to the standard output.  To send the output of a command executed
with @var{system} through the pager, use a command like

@example
disp (system (cmd, 1));
@end example

@noindent
or

@example
printf ("%s
", system (cmd, 1));
@end example

The @code{system} function can return two values.  The first is any
output from the command that was written to the standard output stream,
and the second is the output status of the command.  For example,

@example
[output, status] = system ("echo foo; exit 2");
@end example

@noindent
will set the variable @code{output} to the string @samp{foo}, and the
variable @code{status} to the integer @samp{2}.
@end deftypefn
atexit
-*- texinfo -*-
@deftypefn {Built-in Function} {} atexit (@var{fcn})
Register a function to be called when Octave exits.  For example,

@example
@group
function print_fortune ()
  printf ("\n%s\n", system ("fortune"));
  fflush (stdout);
endfunction
atexit ("print_fortune");
@end group
@end example

@noindent
will print a message when Octave exits.
@end deftypefn
octave_config_info
-*- texinfo -*-
@deftypefn {Built-in Function} {} octave_config_info (@var{option})
Return a structure containing configuration and installation
information for Octave.

if @var{option} is a string, return the configuration information for the
specified option.

@end deftypefn
argv
-*- texinfo -*-
@defvr {Built-in Variable} argv
The command line arguments passed to Octave are available in this
variable.  For example, if you invoked Octave using the command

@example
octave --no-line-editing --silent
@end example

@noindent
@code{argv} would be a cell array of strings with the elements
@code{--no-line-editing} and @code{--silent}.

If you write an executable Octave script, @code{argv} will contain the
list of arguments passed to the script.  @xref{Executable Octave Programs},
for an example of how to create an executable Octave script.
@end defvr
program_invocation_name
-*- texinfo -*-
@defvr {Built-in Variable} program_invocation_name
@defvrx {Built-in Variable} program_name
When Octave starts, the value of the built-in variable
@code{program_invocation_name} is automatically set to the name that was
typed at the shell prompt to run Octave, and the value of
@code{program_name} is automatically set to the final component of
@code{program_invocation_name}.  For example, if you typed
@samp{@value{OCTAVEHOME}/bin/octave} to start Octave,
@code{program_invocation_name} would have the value
@code{"@value{OCTAVEHOME}/bin/octave"}, and @code{program_name} would
have the value @code{"octave"}.

If executing a script from the command line (e.g., @code{octave foo.m})
or using an executable Octave script, the program name is set to the
name of the script.  @xref{Executable Octave Programs}, for an example of
how to create an executable Octave script.
@end defvr
program_name
-*- texinfo -*-
@defvr {Built-in Variable} program_invocation_name
@defvrx {Built-in Variable} program_name
When Octave starts, the value of the built-in variable
@code{program_invocation_name} is automatically set to the name that was
typed at the shell prompt to run Octave, and the value of
@code{program_name} is automatically set to the final component of
@code{program_invocation_name}.  For example, if you typed
@samp{@value{OCTAVEHOME}/bin/octave} to start Octave,
@code{program_invocation_name} would have the value
@code{"@value{OCTAVEHOME}/bin/octave"}, and @code{program_name} would
have the value @code{"octave"}.

If executing a script from the command line (e.g., @code{octave foo.m})
or using an executable Octave script, the program name is set to the
name of the script.  @xref{Executable Octave Programs}, for an example of
how to create an executable Octave script.
@end defvr
isvarname
@deftypefn {Built-in Function} {} isvarname (@var{name})
Return true if @var{name} is a valid variable name
@end deftypefn
file_in_loadpath
-*- texinfo -*-
@deftypefn {Built-in Function} {} file_in_loadpath (@var{file})
@deftypefnx {Built-in Function} {} file_in_loadpath (@var{file}, "all")

Return the absolute name name of @var{file} if it can be found in
the list of directories specified by @code{LOADPATH}.
If no file is found, return an empty matrix.

If the first argument is a cell array of of strings, search each
directory of the loadpath for element of the cell array and return
the first that matches.

If the second optional argument @code{"all"} is supplied, return
a cell array containing the list of all files that have the same
name in the path.  If no files are found, return an empty cell array.
@end deftypefn
@seealso{file_in_path}
file_in_path
-*- texinfo -*-
@deftypefn {Built-in Function} {} file_in_path (@var{path}, @var{file})
@deftypefnx {Built-in Function} {} file_in_path (@var{path}, @var{file}, "all")
Return the absolute name name of @var{file} if it can be found in
@var{path}.  The value of @var{path} should be a colon-separated list of
directories in the format described for the built-in variable
@code{LOADPATH}.  If no file is found, return an empty matrix.
For example,

@example
file_in_path (LOADPATH, "nargchk.m")
     @result{} "@value{OCTAVEHOME}/share/octave/2.0/m/general/nargchk.m"
@end example

If the second argument is a cell array of of strings, search each
directory of the path for element of the cell array and return
the first that matches.

If the third optional argument @code{"all"} is supplied, return
a cell array containing the list of all files that have the same
name in the path.  If no files are found, return an empty cell array.
@seealso{file_in_loadpath}
@end deftypefn
do_string_escapes
-*- texinfo -*-
@deftypefn {Built-in Function} {} do_string_escapes (@var{string})
Convert special characters in @var{string} to their escaped forms.
@end deftypefn
undo_string_escapes
-*- texinfo -*-
@deftypefn {Built-in Function} {} undo_string_escapes (@var{s})
Converts special characters in strings back to their escaped forms.  For
example, the expression

@example
bell = "\a";
@end example

@noindent
assigns the value of the alert character (control-g, ASCII code 7) to
the string variable @code{bell}.  If this string is printed, the
system will ring the terminal bell (if it is possible).  This is
normally the desired outcome.  However, sometimes it is useful to be
able to print the original representation of the string, with the
special characters replaced by their escape sequences.  For example,

@example
octave:13> undo_string_escapes (bell)
ans = \a
@end example

@noindent
replaces the unprintable alert character with its printable
representation.
@end deftypefn
find_first_of_in_loadpath

ERRNO
-*- texinfo -*-
@deftypefn {Built-in Function} {@var{system_error_number}} errno ()
Return the current value of the system-dependent variable errno.
@end deftypefn
warn_neg_dim_as_zero
-*- texinfo -*-
@defvr {Built-in Variable} warn_neg_dim_as_zero
If the value of @code{warn_neg_dim_as_zero} is nonzero, print a warning
for expressions like

@example
eye (-1)
@end example

@noindent
The default value is 0.
@end defvr
mark_as_command
-*- texinfo -*-
@deftypefn {Built-in Function} {} mark_as_command (@var{name})
Enter @var{name} into the list of commands.
@end deftypefn
unmark_command
-*- texinfo -*-
@deftypefn {Built-in Function} {} mark_as_command (@var{name})
Remove @var{name} from the list of commands.
@end deftypefn
isglobal
-*- texinfo -*-
@deftypefn {Built-in Function} {} isglobal (@var{name})
Return 1 if @var{name} is globally visible.  Otherwise, return 0.  For
example,

@example
@group
global x
isglobal ("x")
     @result{} 1
@end group
@end example
@end deftypefn
exist
-*- texinfo -*-
@deftypefn {Built-in Function} {} exist (@var{name}, @var{type})
Return 1 if the name exists as a variable, 2 if the name (after
appending @samp{.m}) is a function file in Octave's LOADPATH, 3 if the
name is a @samp{.oct} file in Octave's LOADPATH, 5 if the name is a
built-in function, 7 if the name is a directory, 101 if the name is
a built-in variable, 102 if the name is a built-in constant, or 103
if the name is a function not associated with a file (entered on
the command line).

Otherwise, return 0.

This function also returns 2 if a regular file called @var{name}
exists in Octave's @code{LOADPATH}.  If you want information about
other types of files, you should use some combination of the functions
@code{file_in_path} and @code{stat} instead.

If the optional argument @var{type} is supplied, check only for
symbols of the specified type.  Valid types are

@table @samp
@item "var"
Check only for variables.
@item "builtin"
Check only for built-in functions.
@item "file"
Check only for files.
@item "dir"
Check only for directories.
@end table
@end deftypefn
document
-*- texinfo -*-
@deftypefn {Built-in Function} {} document (@var{symbol}, @var{text})
Set the documentation string for @var{symbol} to @var{text}.
@end deftypefn
who
-*- texinfo -*-
@deffn {Command} who options pattern @dots{}
@deffnx {Command} whos options pattern @dots{}
List currently defined symbols matching the given patterns.  The
following are valid options.  They may be shortened to one character but
may not be combined.

@table @code
@item -all
List all currently defined symbols.

@item -builtins
List built-in variables and functions.  This includes all currently
compiled function files, but does not include all function files that
are in the @code{LOADPATH}.

@item -functions
List user-defined functions.

@item -long
Print a long listing including the type and dimensions of any symbols.
The symbols in the first column of output indicate whether it is
possible to redefine the symbol, and whether it is possible for it to be
cleared.

@item -variables
List user-defined variables.
@end table

Valid patterns are the same as described for the @code{clear} command
above.  If no patterns are supplied, all symbols from the given category
are listed.  By default, only user defined functions and variables
visible in the local scope are displayed.

The command @kbd{whos} is equivalent to @kbd{who -long}.
@end deffn
whos
-*- texinfo -*-
@deffn {Command} whos options pattern @dots{}
See who.
@end deffn
mlock
-*- texinfo -*-
@deftypefn {Built-in Function} {} mlock (@var{name})
Lock the named function into memory.  If no function is named
then lock in the current function.
@end deftypefn
@seealso{munlock, mislocked, and persistent}
munlock
-*- texinfo -*-
@deftypefn {Built-in Function} {} munlock (@var{fcn})
Unlock the named function.  If no function is named
then unlock the current function.
@end deftypefn
@seealso{mlock, mislocked, and persistent}
mislocked
-*- texinfo -*-
@deftypefn {Built-in Function} {} mislocked (@var{fcn})
Return true if the named function is locked.  If no function is named
then return true if the current function is locked.
@end deftypefn
@seealso{mlock, munlock, and persistent}
clear
-*- texinfo -*-
@deffn {Command} clear [-x] pattern @dots{}
Delete the names matching the given patterns from the symbol table.  The
pattern may contain the following special characters:

@table @code
@item ?
Match any single character.

@item *
Match zero or more characters.

@item [ @var{list} ]
Match the list of characters specified by @var{list}.  If the first
character is @code{!} or @code{^}, match all characters except those
specified by @var{list}.  For example, the pattern @samp{[a-zA-Z]} will
match all lower and upper case alphabetic characters.
@end table

For example, the command

@example
clear foo b*r
@end example

@noindent
clears the name @code{foo} and all names that begin with the letter
@code{b} and end with the letter @code{r}.

If @code{clear} is called without any arguments, all user-defined
variables (local and global) are cleared from the symbol table.  If
@code{clear} is called with at least one argument, only the visible
names matching the arguments are cleared.  For example, suppose you have
defined a function @code{foo}, and then hidden it by performing the
assignment @code{foo = 2}.  Executing the command @kbd{clear foo} once
will clear the variable definition and restore the definition of
@code{foo} as a function.  Executing @kbd{clear foo} a second time will
clear the function definition.

With -x, clear the variables that don't match the patterns.

This command may not be used within a function body.
@end deffn
__print_symtab_info__
-*- texinfo -*-
@deftypefn {Built-in Function} {} __print_symtab_info__ ()
Print raw symbol table statistices.
@end deftypefn
__print_symbol_info__
-*- texinfo -*-
@deftypefn {Built-in Function} {} __dump_symbol_info__ (@var{name})
Print symbol table information for the symbol @var{name}.
@end deftypefn
ans
-*- texinfo -*-
@defvr {Built-in Variable} ans
This variable holds the most recently computed result that was not
explicitly assigned to a variable.  For example, after the expression

@example
3^2 + 4^2
@end example

@noindent
is evaluated, the value of @code{ans} is 25.
@end defvr
ignore_function_time_stamp
-*- texinfo -*-
@defvr {Built-in Variable} ignore_function_time_stamp
This variable can be used to prevent Octave from making the system call
@code{stat} each time it looks up functions defined in function files.
If @code{ignore_function_time_stamp} to @code{"system"}, Octave will not
automatically recompile function files in subdirectories of
@file{@var{octave-home}/lib/@var{version}} if they have changed since
they were last compiled, but will recompile other function files in the
@code{LOADPATH} if they change.  If set to @code{"all"}, Octave will not
recompile any function files unless their definitions are removed with
@code{clear}.  For any other value of @code{ignore_function_time_stamp},
Octave will always check to see if functions defined in function files
need to recompiled.  The default value of @code{ignore_function_time_stamp} is
@code{"system"}.
@end defvr
