# HG changeset patch # User Rik # Date 1276053758 25200 # Node ID a8ce6bdecce5381f3f2f66f4134efb5d0cccdf59 # Parent 8675858ba1e2d2d67c07bd6f6dfd52e69daeafd1 Improve documentation strings. diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,22 @@ +2010-06-03 Rik + + * general/arrayfun.m, general/cart2pol.m, general/cart2sph.m, + general/idivide.m, general/logspace.m, general/sph2cart.m, + general/structfun.m, image/imagesc.m, io/csvread.m, io/csvwrite.m, + linear-algebra/cond.m, linear-algebra/condest.m, + linear-algebra/isdefinite.m, linear-algebra/null.m, + linear-algebra/orth.m, miscellaneous/list_primes.m, + optimization/fminunc.m, optimization/fzero.m, path/matlabroot.m, + plot/axis.m, plot/plot.m, plot/semilogx.m, plot/semilogxerr.m, + plot/semilogy.m, plot/semilogyerr.m, plot/stem.m, polynomial/poly.m, + polynomial/polyder.m, polynomial/polyderiv.m, polynomial/polyfit.m, + polynomial/polyout.m, polynomial/polyval.m, set/ismember.m, + sparse/spfun.m, specfun/betaln.m, statistics/base/mean.m, + statistics/base/median.m, statistics/base/mode.m, statistics/base/ols.m, + statistics/base/ranks.m, + statistics/distributions/kolmogorov_smirnov_cdf.m, + statistics/distributions/wblpdf.m: Improve documentation strings + 2010-06-07 Jaroslav Hajek * pkg/pkg.m: Support pkg list -forge. diff --git a/scripts/general/arrayfun.m b/scripts/general/arrayfun.m --- a/scripts/general/arrayfun.m +++ b/scripts/general/arrayfun.m @@ -125,7 +125,7 @@ ## @end group ## @end example ## -## @seealso{cellfun, spfun, structfun} +## @seealso{spfun, cellfun, structfun} ## @end deftypefn ## Author: Bill Denney diff --git a/scripts/general/cart2pol.m b/scripts/general/cart2pol.m --- a/scripts/general/cart2pol.m +++ b/scripts/general/cart2pol.m @@ -22,7 +22,7 @@ ## Transform Cartesian to polar or cylindrical coordinates. ## @var{x}, @var{y} (and @var{z}) must be the same shape, or scalar. ## @var{theta} describes the angle relative to the positive x-axis. -## @var{r} is the distance to the z-axis (0, 0, z). +## @var{r} is the distance to the z-axis @w{(0, 0, z)}. ## @seealso{pol2cart, cart2sph, sph2cart} ## @end deftypefn diff --git a/scripts/general/cart2sph.m b/scripts/general/cart2sph.m --- a/scripts/general/cart2sph.m +++ b/scripts/general/cart2sph.m @@ -22,7 +22,7 @@ ## @var{x}, @var{y} and @var{z} must be the same shape, or scalar. ## @var{theta} describes the angle relative to the positive x-axis. ## @var{phi} is the angle relative to the xy-plane. -## @var{r} is the distance to the origin (0, 0, 0). +## @var{r} is the distance to the origin @w{(0, 0, 0)}. ## @seealso{pol2cart, cart2pol, sph2cart} ## @end deftypefn diff --git a/scripts/general/idivide.m b/scripts/general/idivide.m --- a/scripts/general/idivide.m +++ b/scripts/general/idivide.m @@ -18,10 +18,11 @@ ## -*- texinfo -*- ## @deftypefn {Function File} {} idivide (@var{x}, @var{y}, @var{op}) -## Integer division with different round rules. The standard behavior of -## the an integer division such as @code{@var{a} ./ @var{b}} is to round -## the result to the nearest integer. This is not always the desired -## behavior and @code{idivide} permits integer element-by-element +## Integer division with different rounding rules. +## +## The standard behavior of integer division such as @code{@var{a} ./ @var{b}} +## is to round the result to the nearest integer. This is not always the +## desired behavior and @code{idivide} permits integer element-by-element ## division to be performed with different treatment for the fractional ## part of the division as determined by the @var{op} flag. @var{op} is ## a string with one of the values: @@ -35,14 +36,14 @@ ## towards the nearest integer. ## @item "floor" ## Calculate @code{@var{a} ./ @var{b}} with the fractional part rounded -## downwards. +## towards negative infinity. ## @item "ceil" ## Calculate @code{@var{a} ./ @var{b}} with the fractional part rounded -## upwards. +## towards positive infinity. ## @end table ## ## @noindent -## If @var{op} is not given it is assumed that it is @code{"fix"}. +## If @var{op} is not given it defaults to @code{"fix"}. ## An example demonstrating these rounding rules is ## ## @example @@ -51,10 +52,10 @@ ## @result{} int8 ([0, 0]) ## idivide (int8 ([-3, 3]), int8 (4), "round") ## @result{} int8 ([-1, 1]) +## idivide (int8 ([-3, 3]), int8 (4), "floor") +## @result{} int8 ([-1, 0]) ## idivide (int8 ([-3, 3]), int8 (4), "ceil") ## @result{} int8 ([0, 1]) -## idivide (int8 ([-3, 3]), int8 (4), "floor") -## @result{} int8 ([-1, 0]) ## @end group ## @end example ## diff --git a/scripts/general/logspace.m b/scripts/general/logspace.m --- a/scripts/general/logspace.m +++ b/scripts/general/logspace.m @@ -18,7 +18,8 @@ ## . ## -*- texinfo -*- -## @deftypefn {Function File} {} logspace (@var{base}, @var{limit}, @var{n}) +## @deftypefn {Function File} {} logspace (@var{base}, @var{limit}) +## @deftypefnx {Function File} {} logspace (@var{base}, @var{limit}, @var{n}) ## Similar to @code{linspace} except that the values are logarithmically ## spaced from ## @tex @@ -51,9 +52,10 @@ ## @end ifnottex ## in order to be compatible with the corresponding @sc{matlab} ## function. +## If @var{n} is unspecified it defaults to 50. ## -## Also for compatibility, return the second argument if fewer than two -## values are requested. +## Also for compatibility with @sc{matlab}, return the second argument if +## fewer than two values are requested. ## @seealso{linspace} ## @end deftypefn diff --git a/scripts/general/sph2cart.m b/scripts/general/sph2cart.m --- a/scripts/general/sph2cart.m +++ b/scripts/general/sph2cart.m @@ -22,7 +22,7 @@ ## @var{x}, @var{y} and @var{z} must be the same shape, or scalar. ## @var{theta} describes the angle relative to the positive x-axis. ## @var{phi} is the angle relative to the xy-plane. -## @var{r} is the distance to the origin (0, 0, 0). +## @var{r} is the distance to the origin @w{(0, 0, 0)}. ## @seealso{pol2cart, cart2pol, cart2sph} ## @end deftypefn diff --git a/scripts/general/structfun.m b/scripts/general/structfun.m --- a/scripts/general/structfun.m +++ b/scripts/general/structfun.m @@ -18,7 +18,7 @@ ## . ## -*- texinfo -*- -## @deftypefn {Function File} {} structfun (@var{func}, @var{s}) +## @deftypefn {Function File} {} structfun (@var{func}, @var{s}) ## @deftypefnx {Function File} {[@var{a}, @dots{}] =} structfun (@dots{}) ## @deftypefnx {Function File} {} structfun (@dots{}, "ErrorHandler", @var{errfunc}) ## @deftypefnx {Function File} {} structfun (@dots{}, "UniformOutput", @var{val}) @@ -67,7 +67,7 @@ ## of the element that caused the error. For an example on how to use ## an error handler, @pxref{doc-cellfun, @code{cellfun}}. ## -## @seealso{cellfun, arrayfun} +## @seealso{cellfun, arrayfun, spfun} ## @end deftypefn function varargout = structfun (fun, s, varargin); diff --git a/scripts/image/imagesc.m b/scripts/image/imagesc.m --- a/scripts/image/imagesc.m +++ b/scripts/image/imagesc.m @@ -18,7 +18,7 @@ ## . ## -*- texinfo -*- -## @deftypefn {Function File} {} imagesc (@var{a}) +## @deftypefn {Function File} {} imagesc (@var{a}) ## @deftypefnx {Function File} {} imagesc (@var{x}, @var{y}, @var{a}) ## @deftypefnx {Function File} {} imagesc (@dots{}, @var{limits}) ## @deftypefnx {Function File} {} imagesc (@var{h}, @dots{}) diff --git a/scripts/io/csvread.m b/scripts/io/csvread.m --- a/scripts/io/csvread.m +++ b/scripts/io/csvread.m @@ -18,11 +18,11 @@ ## -*- texinfo -*- ## @deftypefn {Function File} {@var{x} =} csvread (@var{filename}) -## Read the matrix @var{x} from a file. +## Read the comma-separated-value file @var{filename} into the matrix @var{x}. ## ## This function is equivalent to ## @example -## dlmread (@var{filename}, "," , @dots{}) +## @var{x} = dlmread (@var{filename}, "," , @dots{}) ## @end example ## ## @seealso{dlmread, dlmwrite, csvwrite} diff --git a/scripts/io/csvwrite.m b/scripts/io/csvwrite.m --- a/scripts/io/csvwrite.m +++ b/scripts/io/csvwrite.m @@ -17,8 +17,9 @@ ## . ## -*- texinfo -*- -## @deftypefn {Function File} {@var{x} =} csvwrite (@var{filename}, @var{x}) -## Write the matrix @var{x} to a file. +## @deftypefn {Function File} {} csvwrite (@var{filename}, @var{x}) +## Write the matrix @var{x} to the file @var{filename} in +## @w{comma-separated-value} format. ## ## This function is equivalent to ## @example diff --git a/scripts/linear-algebra/cond.m b/scripts/linear-algebra/cond.m --- a/scripts/linear-algebra/cond.m +++ b/scripts/linear-algebra/cond.m @@ -31,7 +31,7 @@ ## ## By default @code{@var{p} = 2} is used which implies a (relatively slow) ## singular value decomposition. Other possible selections are -## @code{@var{p} = 1, Inf, "inf", "fro"} which are generally faster. See +## @code{@var{p} = 1, Inf, "fro"} which are generally faster. See ## @code{norm} for a full discussion of possible @var{p} values. ## @seealso{condest, rcond, norm, svd} ## @end deftypefn diff --git a/scripts/linear-algebra/condest.m b/scripts/linear-algebra/condest.m --- a/scripts/linear-algebra/condest.m +++ b/scripts/linear-algebra/condest.m @@ -17,7 +17,9 @@ ## . ## -*- texinfo -*- -## @deftypefn {Function File} {[@var{est}, @var{v}] =} condest (@var{a}, @var{t}) +## @deftypefn {Function File} {} condest (@var{a}) +## @deftypefnx {Function File} {} condest (@var{a}, @var{t}) +## @deftypefnx {Function File} {[@var{est}, @var{v}] =} condest (@dots{}) ## @deftypefnx {Function File} {[@var{est}, @var{v}] =} condest (@var{a}, @var{solve}, @var{solve_t}, @var{t}) ## @deftypefnx {Function File} {[@var{est}, @var{v}] =} condest (@var{apply}, @var{apply_t}, @var{solve}, @var{solve_t}, @var{n}, @var{t}) ## @@ -52,11 +54,11 @@ ## ## References: ## @itemize -## @item Nicholas J. Higham and Françoise Tisseur, "A Block Algorithm +## @item Nicholas J. Higham and Francoise Tisseur, "A Block Algorithm ## for Matrix 1-Norm Estimation, with an Application to 1-Norm ## Pseudospectra." SIMAX vol 21, no 4, pp 1185-1201. ## @url{http://dx.doi.org/10.1137/S0895479899356080} -## @item Nicholas J. Higham and Françoise Tisseur, "A Block Algorithm +## @item Nicholas J. Higham and Francoise Tisseur, "A Block Algorithm ## for Matrix 1-Norm Estimation, with an Application to 1-Norm ## Pseudospectra." @url{http://citeseer.ist.psu.edu/223007.html} ## @end itemize diff --git a/scripts/linear-algebra/isdefinite.m b/scripts/linear-algebra/isdefinite.m --- a/scripts/linear-algebra/isdefinite.m +++ b/scripts/linear-algebra/isdefinite.m @@ -17,12 +17,13 @@ ## . ## -*- texinfo -*- -## @deftypefn {Function File} {} isdefinite (@var{x}, @var{tol}) +## @deftypefn {Function File} {} isdefinite (@var{x}) +## @deftypefnx {Function File} {} isdefinite (@var{x}, @var{tol}) ## Return 1 if @var{x} is symmetric positive definite within the ## tolerance specified by @var{tol} or 0 if @var{x} is symmetric ## positive semidefinite. Otherwise, return -1. If @var{tol} -## is omitted, use a tolerance equal to 100 times the machine precision, -## multiplied by the Frobeniusm norm of @var{x}. +## is omitted, use a tolerance of +## @code{100 * eps * norm (@var{x}, "fro")} ## @seealso{issymmetric} ## @end deftypefn diff --git a/scripts/linear-algebra/null.m b/scripts/linear-algebra/null.m --- a/scripts/linear-algebra/null.m +++ b/scripts/linear-algebra/null.m @@ -28,6 +28,7 @@ ## @example ## max (size (@var{a})) * max (svd (@var{a})) * eps ## @end example +## @seealso{orth} ## @end deftypefn ## Author: KH diff --git a/scripts/linear-algebra/orth.m b/scripts/linear-algebra/orth.m --- a/scripts/linear-algebra/orth.m +++ b/scripts/linear-algebra/orth.m @@ -28,6 +28,7 @@ ## @example ## max (size (@var{a})) * max (svd (@var{a})) * eps ## @end example +## @seealso{null} ## @end deftypefn ## Author: KH diff --git a/scripts/miscellaneous/list_primes.m b/scripts/miscellaneous/list_primes.m --- a/scripts/miscellaneous/list_primes.m +++ b/scripts/miscellaneous/list_primes.m @@ -18,7 +18,8 @@ ## . ## -*- texinfo -*- -## @deftypefn {Function File} {} list_primes (@var{n}) +## @deftypefn {Function File} {} list_primes () +## @deftypefnx {Function File} {} list_primes (@var{n}) ## List the first @var{n} primes. If @var{n} is unspecified, the first ## 25 primes are listed. ## diff --git a/scripts/optimization/fminunc.m b/scripts/optimization/fminunc.m --- a/scripts/optimization/fminunc.m +++ b/scripts/optimization/fminunc.m @@ -19,15 +19,16 @@ ## Author: Jaroslav Hajek ## -*- texinfo -*- -## @deftypefn{Function File} {} fminunc (@var{fcn}, @var{x0}, @var{options}) -## @deftypefnx{Function File} {[@var{x}, @var{fvec}, @var{info}, @var{output}, @var{grad}, @var{hess}]} = fminunc (@var{fcn}, @dots{}) -## Solve a unconstrained optimization problem defined by the function @var{fcn}. +## @deftypefn {Function File} {} fminunc (@var{fcn}, @var{x0}) +## @deftypefnx {Function File} {} fminunc (@var{fcn}, @var{x0}, @var{options}) +## @deftypefnx {Function File} {[@var{x}, @var{fvec}, @var{info}, @var{output}, @var{grad}, @var{hess}]} = fminunc (@var{fcn}, @dots{}) +## Solve an unconstrained optimization problem defined by the function @var{fcn}. ## @var{fcn} should accepts a vector (array) defining the unknown variables, ## and return the objective function value, optionally with gradient. ## In other words, this function attempts to determine a vector @var{x} such ## that @code{@var{fcn} (@var{x})} is a local minimum. ## @var{x0} determines a starting guess. The shape of @var{x0} is preserved -## in all calls to @var{fcn}, but otherwise it is treated as a column vector. +## in all calls to @var{fcn}, but otherwise is treated as a column vector. ## @var{options} is a structure specifying additional options. ## Currently, @code{fminunc} recognizes these options: ## @code{"FunValCheck"}, @code{"OutputFcn"}, @code{"TolX"}, diff --git a/scripts/optimization/fzero.m b/scripts/optimization/fzero.m --- a/scripts/optimization/fzero.m +++ b/scripts/optimization/fzero.m @@ -19,21 +19,26 @@ ## Author: Jaroslav Hajek ## -*- texinfo -*- -## @deftypefn {Function File} {[@var{x}, @var{fval}, @var{info}, @var{output}] =} fzero (@var{fun}, @var{x0}, @var{options}) -## Find a zero point of a univariate function. @var{fun} should be a function -## handle or name. @var{x0} should be a two-element vector specifying the initial -## bracketing. It should hold +## @deftypefn {Function File} {} fzero (@var{fun}, @var{x0}) +## @deftypefnx {Function File} {} fzero (@var{fun}, @var{x0}, @var{options}) +## @deftypefnx {Function File} {[@var{x}, @var{fval}, @var{info}, @var{output}] =} fzero (@dots{}) +## Find a zero of a univariate function. +## +## @var{fun} should be a function handle or name. @var{x0} should be a +## two-element vector specifying two points which bracket a zero. In +## other words, there must be a change in sign of the function between +## @var{x0}(1) and @var{x0}(2). More mathematically, the following must hold ## @example ## sign (@var{fun}(@var{x0}(1))) * sign (@var{fun}(@var{x0}(2))) <= 0 ## @end example -## If only a single scalar is given as @var{x0}, several nearby and distant -## values are probed in an attempt to obtain a valid bracketing. If this +## If @var{x0} is a single scalar then several nearby and distant +## values are probed in an attempt to obtain a valid bracketing. If this ## is not successful, the function fails. ## @var{options} is a structure specifying additional options. ## Currently, @code{fzero} ## recognizes these options: @code{"FunValCheck"}, @code{"OutputFcn"}, ## @code{"TolX"}, @code{"MaxIter"}, @code{"MaxFunEvals"}. -## For description of these options, see @ref{doc-optimset,,optimset}. +## For a description of these options, see @ref{doc-optimset,,optimset}. ## ## On exit, the function returns @var{x}, the approximate zero point ## and @var{fval}, the function value thereof. @@ -41,14 +46,28 @@ ## ## @itemize ## @item 1 -## The algorithm converged to a solution. +## The algorithm converged to a solution. ## @item 0 -## Maximum number of iterations or function evaluations has been exhausted. +## Maximum number of iterations or function evaluations has been reached. ## @item -1 ## The algorithm has been terminated from user output function. ## @item -5 ## The algorithm may have converged to a singular point. ## @end itemize +## +## @var{output} is a structure containing runtime information about the +## @code{fzero} algorithm. Fields in the structure are: +## +## @itemize +## @item iterations +## Number of iterations through loop. +## @item nfev +## Number of function evaluations. +## @item bracketx +## A two-element vector with the final bracketing of the zero along the x-axis. +## @item brackety +## A two-element vector with the final bracketing of the zero along the y-axis. +## @end itemize ## @seealso{optimset, fsolve} ## @end deftypefn @@ -310,8 +329,8 @@ output.iterations = niter; output.funcCount = nfev; - output.bracket = [a, b]; - output.bracketf = [fa, fb]; + output.bracketx = [a, b]; + output.brackety = [fa, fb]; endfunction diff --git a/scripts/path/matlabroot.m b/scripts/path/matlabroot.m --- a/scripts/path/matlabroot.m +++ b/scripts/path/matlabroot.m @@ -18,7 +18,7 @@ ## -*- texinfo -*- ## @deftypefn {Function File} {@var{val} =} matlabroot () -## Return the location of Octave's home. +## Return the location of Octave's home directory. ## @seealso{OCTAVE_HOME} ## @end deftypefn diff --git a/scripts/plot/axis.m b/scripts/plot/axis.m --- a/scripts/plot/axis.m +++ b/scripts/plot/axis.m @@ -18,7 +18,14 @@ ## . ## -*- texinfo -*- -## @deftypefn {Function File} {} axis (@var{limits}) +## @deftypefn {Function File} {} axis () +## @deftypefnx {Function File} {} axis ([@var{x}_lo, @var{x}_hi]) +## @deftypefnx {Function File} {} axis ([@var{x}_lo, @var{x}_hi, @var{y}_lo, @var{y}_hi]) +## @deftypefnx {Function File} {} axis ([@var{x}_lo, @var{x}_hi, @var{y}_lo, @var{y}_hi, @var{z}_lo, @var{z}_hi]) +## @deftypefnx {Function File} {} axis (@var{option}) +## @deftypefnx {Function File} {} axis (@dots{}, @var{option}) +## @deftypefnx {Function File} {} axis (@var{h}, @dots{}) +## @deftypefnx {Function File} {@var{limits} =} axis () ## Set axis limits for plots. ## ## The argument @var{limits} should be a 2, 4, or 6 element vector. The @@ -28,7 +35,7 @@ ## ## Without any arguments, @code{axis} turns autoscaling on. ## -## With one output argument, @code{x = axis} returns the current axes +## With one output argument, @code{x = axis} returns the current axes. ## ## The vector argument specifying limits is optional, and additional ## string arguments may be used to specify various axis properties. For diff --git a/scripts/plot/plot.m b/scripts/plot/plot.m --- a/scripts/plot/plot.m +++ b/scripts/plot/plot.m @@ -18,11 +18,12 @@ ## . ## -*- texinfo -*- -## @deftypefn {Function File} {} plot (@var{y}) +## @deftypefn {Function File} {} plot (@var{y}) ## @deftypefnx {Function File} {} plot (@var{x}, @var{y}) ## @deftypefnx {Function File} {} plot (@var{x}, @var{y}, @var{property}, @var{value}, @dots{}) ## @deftypefnx {Function File} {} plot (@var{x}, @var{y}, @var{fmt}) ## @deftypefnx {Function File} {} plot (@var{h}, @dots{}) +## @deftypefnx {Function File} {@var{h} =} plot (@dots{}) ## Produces two-dimensional plots. Many different combinations of ## arguments are possible. The simplest form is ## diff --git a/scripts/plot/semilogx.m b/scripts/plot/semilogx.m --- a/scripts/plot/semilogx.m +++ b/scripts/plot/semilogx.m @@ -19,7 +19,7 @@ ## -*- texinfo -*- ## @deftypefn {Function File} {} semilogx (@var{args}) -## Produce a two-dimensional plot using a log scale for the @var{x} +## Produce a two-dimensional plot using a logarithmic scale for the @var{x} ## axis. See the description of @code{plot} for a description of the ## arguments that @code{semilogx} will accept. ## @seealso{plot, semilogy, loglog} diff --git a/scripts/plot/semilogxerr.m b/scripts/plot/semilogxerr.m --- a/scripts/plot/semilogxerr.m +++ b/scripts/plot/semilogxerr.m @@ -19,18 +19,18 @@ ## -*- texinfo -*- ## @deftypefn {Function File} {} semilogxerr (@var{args}) -## Produce two-dimensional plots on a semilogarithm axis with errorbars. -## Many different combinations of arguments are possible. The most used -## form is +## Produce two-dimensional plots using a logarithmic scale for the @var{x} +## axis and errorbars at each data point. Many different combinations of +## arguments are possible. The most used form is ## ## @example ## semilogxerr (@var{x}, @var{y}, @var{ey}, @var{fmt}) ## @end example ## ## @noindent -## which produces a semi-logarithm plot of @var{y} versus @var{x} +## which produces a semi-logarithmic plot of @var{y} versus @var{x} ## with errors in the @var{y}-scale defined by @var{ey} and the plot -## format defined by @var{fmt}. See errorbar for available formats and +## format defined by @var{fmt}. See @code{errorbar} for available formats and ## additional information. ## @seealso{errorbar, loglogerr semilogyerr} ## @end deftypefn diff --git a/scripts/plot/semilogy.m b/scripts/plot/semilogy.m --- a/scripts/plot/semilogy.m +++ b/scripts/plot/semilogy.m @@ -19,7 +19,7 @@ ## -*- texinfo -*- ## @deftypefn {Function File} {} semilogy (@var{args}) -## Produce a two-dimensional plot using a log scale for the @var{y} +## Produce a two-dimensional plot using a logarithmic scale for the @var{y} ## axis. See the description of @code{plot} for a description of the ## arguments that @code{semilogy} will accept. ## @seealso{plot, semilogx, loglog} diff --git a/scripts/plot/semilogyerr.m b/scripts/plot/semilogyerr.m --- a/scripts/plot/semilogyerr.m +++ b/scripts/plot/semilogyerr.m @@ -18,18 +18,18 @@ ## -*- texinfo -*- ## @deftypefn {Function File} {} semilogyerr (@var{args}) -## Produce two-dimensional plots on a semilogarithm axis with errorbars. -## Many different combinations of arguments are possible. The most used -## form is +## Produce two-dimensional plots using a logarithmic scale for the @var{y} +## axis and errorbars at each data point. Many different combinations of +## arguments are possible. The most used form is ## ## @example ## semilogyerr (@var{x}, @var{y}, @var{ey}, @var{fmt}) ## @end example ## ## @noindent -## which produces a semi-logarithm plot of @var{y} versus @var{x} +## which produces a semi-logarithmic plot of @var{y} versus @var{x} ## with errors in the @var{y}-scale defined by @var{ey} and the plot -## format defined by @var{fmt}. See errorbar for available formats and +## format defined by @var{fmt}. See @code{errorbar} for available formats and ## additional information. ## @seealso{errorbar, loglogerr semilogxerr} ## @end deftypefn diff --git a/scripts/plot/stem.m b/scripts/plot/stem.m --- a/scripts/plot/stem.m +++ b/scripts/plot/stem.m @@ -17,8 +17,11 @@ ## . ## -*- texinfo -*- -## @deftypefn {Function File} {@var{h} =} stem (@var{x}, @var{y}, @var{linespec}) -## @deftypefnx {Function File} {@var{h} =} stem (@dots{}, "filled") +## @deftypefn {Function File} {} stem (@var{x}) +## @deftypefnx {Function File} {} stem (@var{x}, @var{y}) +## @deftypefnx {Function File} {} stem (@var{x}, @var{y}, @var{linespec}) +## @deftypefnx {Function File} {} stem (@dots{}, "filled") +## @deftypefnx {Function File} {@var{h} =} stem (@dots{}) ## Plot a stem graph from two vectors of x-y data. If only one argument ## is given, it is taken as the y-values and the x coordinates are taken ## from the indices of the elements. @@ -28,7 +31,7 @@ ## the same length as the number of rows in @var{y}, or it can be a ## matrix of the same size as @var{y}. ## -## The default color is @code{"r"} (red). The default line style is +## The default color is @code{"b"} (blue). The default line style is ## @code{"-"} and the default marker is @code{"o"}. The line style can ## be altered by the @code{linespec} argument in the same manner as the ## @code{plot} command. For example @@ -37,14 +40,14 @@ ## @group ## x = 1:10; ## y = ones (1, length (x))*2.*x; -## stem (x, y, "b"); +## stem (x, y, "r"); ## @end group ## @end example ## ## @noindent -## plots 10 stems with heights from 2 to 20 in blue; +## plots 10 stems with heights from 2 to 20 in red; ## -## The return value of @code{stem} is a vector if "stem series" graphics +## The return value of @code{stem} is a vector of "stem series" graphics ## handles, with one handle per column of the variable @var{y}. This ## handle regroups the elements of the stem graph together as the ## children of the "stem series" handle, allowing them to be altered @@ -52,7 +55,7 @@ ## ## @example ## @group -## x = [0 : 10].'; +## x = [0 : 10]'; ## y = [sin(x), cos(x)] ## h = stem (x, y); ## set (h(2), "color", "g"); @@ -95,7 +98,7 @@ %!demo %! x = 1:10; %! y = ones (size (x))*2.*x; -%! h = stem (x, y, "b"); +%! h = stem (x, y, "r"); %!demo %! x = 1:10; @@ -110,10 +113,10 @@ %!demo %! x = 1:10; %! y = ones (size (x))*2.*x; -%! h = stem (x, y, "fill"); +%! h = stem (x, y, "filled"); %!demo -%! x = [0 : 10].'; +%! x = [0 : 10]'; %! y = [sin(x), cos(x)]; %! h = stem (x, y); %! set (h(2), "color", "g"); diff --git a/scripts/polynomial/poly.m b/scripts/polynomial/poly.m --- a/scripts/polynomial/poly.m +++ b/scripts/polynomial/poly.m @@ -18,11 +18,13 @@ ## . ## -*- texinfo -*- -## @deftypefn {Function File} {} poly (@var{a}) +## @deftypefn {Function File} {} poly (@var{a}) +## @deftypefnx {Function File} {} poly (@var{x}) ## If @var{a} is a square @math{N}-by-@math{N} matrix, @code{poly (@var{a})} ## is the row vector of the coefficients of @code{det (z * eye (N) - a)}, -## the characteristic polynomial of @var{a}. As an example we can use -## this to find the eigenvalues of @var{a} as the roots of @code{poly (@var{a})}. +## the characteristic polynomial of @var{a}. For example, +## the following code finds the eigenvalues of @var{a} which are the roots of +## @code{poly (@var{a})}. ## @example ## @group ## roots(poly(eye(3))) @@ -31,14 +33,14 @@ ## @result{} 1.00000 + 0.00000i ## @end group ## @end example -## In real-life examples you should, however, use the @code{eig} function -## for computing eigenvalues. +## For numerical performance, however, the @code{eig} function +## should be used for computing eigenvalues. ## ## If @var{x} is a vector, @code{poly (@var{x})} is a vector of coefficients ## of the polynomial whose roots are the elements of @var{x}. That is, -## of @var{c} is a polynomial, then the elements of +## if @var{c} is a polynomial, then the elements of ## @code{@var{d} = roots (poly (@var{c}))} are contained in @var{c}. -## The vectors @var{c} and @var{d} are, however, not equal due to sorting +## The vectors @var{c} and @var{d} are not identical, however, due to sorting ## and numerical errors. ## @seealso{eig, roots} ## @end deftypefn diff --git a/scripts/polynomial/polyder.m b/scripts/polynomial/polyder.m --- a/scripts/polynomial/polyder.m +++ b/scripts/polynomial/polyder.m @@ -17,7 +17,7 @@ ## . ## -*- texinfo -*- -## @deftypefn {Function File} {} polyder (@var{c}) +## @deftypefn {Function File} {} polyder (@var{c}) ## @deftypefnx {Function File} {[@var{q}] =} polyder (@var{b}, @var{a}) ## @deftypefnx {Function File} {[@var{q}, @var{r}] =} polyder (@var{b}, @var{a}) ## See polyderiv. diff --git a/scripts/polynomial/polyderiv.m b/scripts/polynomial/polyderiv.m --- a/scripts/polynomial/polyderiv.m +++ b/scripts/polynomial/polyderiv.m @@ -18,7 +18,7 @@ ## . ## -*- texinfo -*- -## @deftypefn {Function File} {} polyderiv (@var{c}) +## @deftypefn {Function File} {} polyderiv (@var{c}) ## @deftypefnx {Function File} {[@var{q}] =} polyderiv (@var{b}, @var{a}) ## @deftypefnx {Function File} {[@var{q}, @var{r}] =} polyderiv (@var{b}, @var{a}) ## Return the coefficients of the derivative of the polynomial whose diff --git a/scripts/polynomial/polyfit.m b/scripts/polynomial/polyfit.m --- a/scripts/polynomial/polyfit.m +++ b/scripts/polynomial/polyfit.m @@ -18,7 +18,9 @@ ## . ## -*- texinfo -*- -## @deftypefn {Function File} {[@var{p}, @var{s}, @var{mu}] =} polyfit (@var{x}, @var{y}, @var{n}) +## @deftypefn {Function File} {@var{p} =} polyfit (@var{x}, @var{y}, @var{n}) +## @deftypefnx {Function File} {[@var{p}, @var{s}] =} polyfit (@var{x}, @var{y}, @var{n}) +## @deftypefnx {Function File} {[@var{p}, @var{s}, @var{mu}] =} polyfit (@var{x}, @var{y}, @var{n}) ## Return the coefficients of a polynomial @var{p}(@var{x}) of degree ## @var{n} that minimizes the least-squares-error of the fit. ## diff --git a/scripts/polynomial/polyout.m b/scripts/polynomial/polyout.m --- a/scripts/polynomial/polyout.m +++ b/scripts/polynomial/polyout.m @@ -18,7 +18,9 @@ ## . ## -*- texinfo -*- -## @deftypefn {Function File} {} polyout (@var{c}, @var{x}) +## @deftypefn {Function File} {} polyout (@var{c}) +## @deftypefnx {Function File} {} polyout (@var{c}, @var{x}) +## @deftypefnx {Function File} {@var{str} =} polyout (@dots{}) ## Write formatted polynomial ## @tex ## $$ c(x) = c_1 x^n + \ldots + c_n x + c_{n+1} $$ @@ -28,9 +30,9 @@ ## c(x) = c(1) * x^n + @dots{} + c(n) x + c(n+1) ## @end example ## @end ifnottex -## and return it as a string or write it to the screen (if -## @var{nargout} is zero). -## @var{x} defaults to the string @code{"s"}. +## and return it as a string or write it to the screen (if +## @var{nargout} is zero). +## @var{x} defaults to the string @code{"s"}. ## @seealso{polyval, polyvalm, poly, roots, conv, deconv, residue, ## filter, polyderiv, polyint} ## @end deftypefn diff --git a/scripts/polynomial/polyval.m b/scripts/polynomial/polyval.m --- a/scripts/polynomial/polyval.m +++ b/scripts/polynomial/polyval.m @@ -18,10 +18,11 @@ ## . ## -*- texinfo -*- -## @deftypefn {Function File} {@var{y} =} polyval (@var{p}, @var{x}) +## @deftypefn {Function File} {@var{y} =} polyval (@var{p}, @var{x}) ## @deftypefnx {Function File} {@var{y} =} polyval (@var{p}, @var{x}, [], @var{mu}) -## Evaluate the polynomial at of the specified values for @var{x}. When @var{mu} -## is present evaluate the polynomial for (@var{x}-@var{mu}(1))/@var{mu}(2). +## Evaluate the polynomial @var{p} at the specified values of @var{x}. When +## @var{mu} is present evaluate the polynomial for +## (@var{x}-@var{mu}(1))/@var{mu}(2). ## If @var{x} is a vector or matrix, the polynomial is evaluated for each of ## the elements of @var{x}. ## @deftypefnx {Function File} {[@var{y}, @var{dy}] =} polyval (@var{p}, @var{x}, @var{s}) diff --git a/scripts/set/ismember.m b/scripts/set/ismember.m --- a/scripts/set/ismember.m +++ b/scripts/set/ismember.m @@ -18,7 +18,7 @@ ## . ## -*- texinfo -*- -## @deftypefn {Function File} {[@var{tf} =} ismember (@var{A}, @var{S}) +## @deftypefn {Function File} {@var{tf} =} ismember (@var{A}, @var{S}) ## @deftypefnx {Function File} {[@var{tf}, @var{S_idx}] =} ismember (@var{A}, @var{S}) ## @deftypefnx {Function File} {[@var{tf}, @var{S_idx}] =} ismember (@var{A}, @var{S}, "rows") ## Return a matrix @var{tf} with the same shape as @var{A} which has a 1 if diff --git a/scripts/sparse/spfun.m b/scripts/sparse/spfun.m --- a/scripts/sparse/spfun.m +++ b/scripts/sparse/spfun.m @@ -22,7 +22,8 @@ ## Compute @code{f(@var{x})} for the non-zero values of @var{x}. ## This results in a sparse matrix with the same structure as ## @var{x}. The function @var{f} can be passed as a string, a -## function handle or an inline function. +## function handle, or an inline function. +## @seealso{arrayfun, cellfun, structfun} ## @end deftypefn function t = spfun (f, s) diff --git a/scripts/specfun/betaln.m b/scripts/specfun/betaln.m --- a/scripts/specfun/betaln.m +++ b/scripts/specfun/betaln.m @@ -18,7 +18,7 @@ ## -*- texinfo -*- ## @deftypefn {Mapping Function} {} betaln (@var{a}, @var{b}) -## Return the log of the Beta function, +## Return the natural logarithm of the Beta function, ## @tex ## $$ ## B (a, b) = \log {\Gamma (a) \Gamma (b) \over \Gamma (a + b)}. diff --git a/scripts/statistics/base/mean.m b/scripts/statistics/base/mean.m --- a/scripts/statistics/base/mean.m +++ b/scripts/statistics/base/mean.m @@ -18,7 +18,10 @@ ## . ## -*- texinfo -*- -## @deftypefn {Function File} {} mean (@var{x}, @var{dim}, @var{opt}) +## @deftypefn {Function File} {} mean (@var{x}) +## @deftypefnx {Function File} {} mean (@var{x}, @var{dim}) +## @deftypefnx {Function File} {} mean (@var{x}, @var{opt}) +## @deftypefnx {Function File} {} mean (@var{x}, @var{dim}, @var{opt}) ## If @var{x} is a vector, compute the mean of the elements of @var{x} ## @tex ## $$ {\rm mean}(x) = \bar{x} = {1\over N} \sum_{i=1}^N x_i $$ @@ -32,12 +35,12 @@ ## If @var{x} is a matrix, compute the mean for each column and return them ## in a row vector. ## -## With the optional argument @var{opt}, the kind of mean computed can be -## selected. The following options are recognized: +## The optional argument @var{opt} selects the type of mean to compute. +## The following options are recognized: ## ## @table @code ## @item "a" -## Compute the (ordinary) arithmetic mean. This is the default. +## Compute the (ordinary) arithmetic mean. [default] ## ## @item "g" ## Compute the geometric mean. @@ -51,6 +54,7 @@ ## ## Both @var{dim} and @var{opt} are optional. If both are supplied, ## either may appear first. +## @seealso{median,mode} ## @end deftypefn ## Author: KH diff --git a/scripts/statistics/base/median.m b/scripts/statistics/base/median.m --- a/scripts/statistics/base/median.m +++ b/scripts/statistics/base/median.m @@ -19,7 +19,8 @@ ## . ## -*- texinfo -*- -## @deftypefn {Function File} {} median (@var{x}, @var{dim}) +## @deftypefn {Function File} {} median (@var{x}) +## @deftypefnx {Function File} {} median (@var{x}, @var{dim}) ## If @var{x} is a vector, compute the median value of the elements of ## @var{x}. If the elements of @var{x} are sorted, the median is defined ## as @@ -43,7 +44,7 @@ ## If @var{x} is a matrix, compute the median value for each ## column and return them in a row vector. If the optional @var{dim} ## argument is given, operate along this dimension. -## @seealso{std, mean} +## @seealso{mean,mode} ## @end deftypefn ## Author: jwe diff --git a/scripts/statistics/base/mode.m b/scripts/statistics/base/mode.m --- a/scripts/statistics/base/mode.m +++ b/scripts/statistics/base/mode.m @@ -17,16 +17,21 @@ ## . ## -*- texinfo -*- -## @deftypefn {Function File} {[@var{m}, @var{f}, @var{c}] =} mode (@var{x}, @var{dim}) -## Count the most frequently appearing value. @code{mode} counts the -## frequency along the first non-singleton dimension and if two or more -## values have the same frequency returns the smallest of the two in -## @var{m}. The dimension along which to count can be specified by the -## @var{dim} parameter. +## @deftypefn {Function File} {} mode (@var{x}) +## @deftypefnx {Function File} {} mode (@var{x}, @var{dim}) +## @deftypefnx {Function File} {[@var{m}, @var{f}, @var{c}] =} mode (@dots{}) +## Compute the most frequently occurring value in a dataset (mode). +## @code{mode} determines the frequency of values along the first non-singleton +## dimension and returns the value with the highest frequency. If two, or +## more, values have the same frequency @code{mode} returns the smallest. +## +## If the optional argument @var{dim} is supplied, work along dimension +## @var{dim}. ## -## The variable @var{f} counts the frequency of each of the most frequently -## occurring elements. The cell array @var{c} contains all of the elements -## with the maximum frequency . +## The return variable @var{f} is the number of occurrences of the mode in +## in the dataset. The cell array @var{c} contains all of the elements +## with the maximum frequency. +## @seealso{mean,median} ## @end deftypefn function [m, f, c] = mode (x, dim) diff --git a/scripts/statistics/base/ols.m b/scripts/statistics/base/ols.m --- a/scripts/statistics/base/ols.m +++ b/scripts/statistics/base/ols.m @@ -26,7 +26,7 @@ ## $\bar{e} = 0$, and cov(vec($e$)) = kron ($s, I$) ## @end tex ## @ifnottex -## @math{y = x b + e} with +## @w{@math{y = x*b + e}} with ## @math{mean (e) = 0} and @math{cov (vec (e)) = kron (s, I)}. ## @end ifnottex ## where @@ -64,8 +64,7 @@ ## @end example ## ## @item r -## The matrix of OLS residuals, @code{@var{r} = @var{y} - @var{x} * -## @var{beta}}. +## The matrix of OLS residuals, @code{@var{r} = @var{y} - @var{x}*@var{beta}}. ## @end table ## @end deftypefn diff --git a/scripts/statistics/base/ranks.m b/scripts/statistics/base/ranks.m --- a/scripts/statistics/base/ranks.m +++ b/scripts/statistics/base/ranks.m @@ -20,7 +20,7 @@ ## -*- texinfo -*- ## @deftypefn {Function File} {} ranks (@var{x}, @var{dim}) ## Return the ranks of @var{x} along the first non-singleton dimension -## adjust for ties. If the optional argument @var{dim} is +## adjusted for ties. If the optional argument @var{dim} is ## given, operate along this dimension. ## @end deftypefn diff --git a/scripts/statistics/distributions/kolmogorov_smirnov_cdf.m b/scripts/statistics/distributions/kolmogorov_smirnov_cdf.m --- a/scripts/statistics/distributions/kolmogorov_smirnov_cdf.m +++ b/scripts/statistics/distributions/kolmogorov_smirnov_cdf.m @@ -56,14 +56,14 @@ tol = eps; endif else - if (! isscalar (tol) || ! (tol > 0)) - error ("kolmogorov_smirnov_cdf: tol has to be a positive scalar"); + if (! (isscalar (tol) && (tol > 0))) + error ("kolmogorov_smirnov_cdf: tol must be a positive scalar"); endif endif n = numel (x); if (n == 0) - error ("kolmogorov_smirnov_cdf: x must not be empty"); + error ("kolmogorov_smirnov_cdf: X must not be empty"); endif cdf = zeros (size (x)); diff --git a/scripts/statistics/distributions/wblpdf.m b/scripts/statistics/distributions/wblpdf.m --- a/scripts/statistics/distributions/wblpdf.m +++ b/scripts/statistics/distributions/wblpdf.m @@ -21,16 +21,16 @@ ## Compute the probability density function (PDF) at @var{x} of the ## Weibull distribution with shape parameter @var{scale} and scale ## parameter @var{shape} which is given by -## ## @tex ## $$ scale \cdot shape^{-scale} x^{scale-1} \exp(-(x/shape)^{scale}) $$ ## @end tex ## @ifnottex +## ## @example ## scale * shape^(-scale) * x^(scale-1) * exp(-(x/shape)^scale) ## @end example +## ## @end ifnottex -## ## @noindent ## for @var{x} > 0. ## @end deftypefn diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2010-06-08 Rik + + * DLD-FUNCTIONS/bsxfun.cc, DLD-FUNCTIONS/cellfun.cc, + DLD-FUNCTIONS/det.cc, DLD-FUNCTIONS/lookup.cc, DLD-FUNCTIONS/lu.cc, + DLD-FUNCTIONS/rand.cc, DLD-FUNCTIONS/svd.cc, DLD-FUNCTIONS/tril.cc, + data.cc, ov.cc: Improve documentation string. + 2010-06-06 Michael Goffioul * data.cc (Frem, Fmod): Specify template arguments of binmap diff --git a/src/DLD-FUNCTIONS/bsxfun.cc b/src/DLD-FUNCTIONS/bsxfun.cc --- a/src/DLD-FUNCTIONS/bsxfun.cc +++ b/src/DLD-FUNCTIONS/bsxfun.cc @@ -312,7 +312,7 @@ DEFUN_DLD (bsxfun, args, , "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {} bsxfun (@var{f}, @var{a}, @var{b})\n\ -Applies a binary function @var{f} element-wise to two matrix arguments\n\ +Applies a binary function @var{f} element-by-element to two matrix arguments\n\ @var{a} and @var{b}. The function @var{f} must be capable of accepting\n\ two column vector arguments of equal length, or one column vector\n\ argument and a scalar.\n\ diff --git a/src/DLD-FUNCTIONS/cellfun.cc b/src/DLD-FUNCTIONS/cellfun.cc --- a/src/DLD-FUNCTIONS/cellfun.cc +++ b/src/DLD-FUNCTIONS/cellfun.cc @@ -93,7 +93,7 @@ DEFUN_DLD (cellfun, args, nargout, "-*- texinfo -*-\n\ -@deftypefn {Loadable Function} {} cellfun (@var{name}, @var{c})\n\ +@deftypefn {Loadable Function} {} cellfun (@var{name}, @var{c})\n\ @deftypefnx {Loadable Function} {} cellfun (\"size\", @var{c}, @var{k})\n\ @deftypefnx {Loadable Function} {} cellfun (\"isclass\", @var{c}, @var{class})\n\ @deftypefnx {Loadable Function} {} cellfun (@var{func}, @var{c})\n\ @@ -197,7 +197,7 @@ @end group\n\ @end example\n\ \n\ -@seealso{isempty, islogical, isreal, length, ndims, numel, size}\n\ +@seealso{arrayfun, structfun, spfun}\n\ @end deftypefn") { octave_value_list retval; diff --git a/src/DLD-FUNCTIONS/det.cc b/src/DLD-FUNCTIONS/det.cc --- a/src/DLD-FUNCTIONS/det.cc +++ b/src/DLD-FUNCTIONS/det.cc @@ -50,10 +50,14 @@ DEFUN_DLD (det, args, nargout, "-*- texinfo -*-\n\ -@deftypefn {Loadable Function} {[@var{d}, @var{rcond}] =} det (@var{a})\n\ -Compute the determinant of @var{a} using @sc{lapack} for full and UMFPACK\n\ -for sparse matrices. Return an estimate of the reciprocal condition number\n\ -if requested.\n\ +@deftypefn {Loadable Function} {} det (@var{a})\n\ +@deftypefnx {Loadable Function} {[@var{d}, @var{rcond}] =} det (@var{a})\n\ +Compute the determinant of @var{a}.\n\ +\n\ +Routines from @sc{lapack} are used for full matrices and code from\n\ +@sc{umfpack} is used for sparse matrices.\n\ +\n\ +Return an estimate of the reciprocal condition number if requested.\n\ @end deftypefn") { octave_value_list retval; diff --git a/src/DLD-FUNCTIONS/lookup.cc b/src/DLD-FUNCTIONS/lookup.cc --- a/src/DLD-FUNCTIONS/lookup.cc +++ b/src/DLD-FUNCTIONS/lookup.cc @@ -214,17 +214,26 @@ If @var{opts} is specified, it shall be a string with letters indicating\n\ additional options.\n\ \n\ -If 'm' is specified as option, @code{table(idx(i)) == val(i)} if @code{val(i)}\n\ +@table @code\n\ +@item m\n\ +@code{table(idx(i)) == val(i)} if @code{val(i)}\n\ occurs in table; otherwise, @code{idx(i)} is zero.\n\ -If 'b' is specified, then @code{idx(i)} is a logical 1 or 0, indicating whether\n\ +@item b\n\ +@code{idx(i)} is a logical 1 or 0, indicating whether\n\ @code{val(i)} is contained in table or not.\n\ \n\ -For numeric lookup, 'l' in @var{opts} indicates that\n\ +@item l\n\ +For numeric lookups\n\ the leftmost subinterval shall be extended to infinity (i.e., all indices\n\ -at least 1), and 'r' indicates that the rightmost subinterval shall be\n\ -extended to infinity (i.e., all indices at most n-1).\n\ +at least 1)\n\ +@item r\n\ +For numeric lookups\n\ +the rightmost subinterval shall be extended to infinity (i.e., all indices\n\ +at most n-1).\n\ \n\ -For string lookup, 'i' indicates case-insensitive comparison.\n\ +@item i\n\ +For string lookups, use case-insensitive comparison.\n\ +@end table\n\ @end deftypefn") { octave_value retval; diff --git a/src/DLD-FUNCTIONS/lu.cc b/src/DLD-FUNCTIONS/lu.cc --- a/src/DLD-FUNCTIONS/lu.cc +++ b/src/DLD-FUNCTIONS/lu.cc @@ -64,7 +64,8 @@ DEFUN_DLD (lu, args, nargout, "-*- texinfo -*-\n\ -@deftypefn {Loadable Function} {[@var{l}, @var{u}, @var{p}] =} lu (@var{a})\n\ +@deftypefn {Loadable Function} {[@var{l}, @var{u}] =} lu (@var{a})\n\ +@deftypefnx {Loadable Function} {[@var{l}, @var{u}, @var{p}] =} lu (@var{a})\n\ @deftypefnx {Loadable Function} {[@var{l}, @var{u}, @var{p}, @var{q}] =} lu (@var{s})\n\ @deftypefnx {Loadable Function} {[@var{l}, @var{u}, @var{p}, @var{q}, @var{r}] =} lu (@var{s})\n\ @deftypefnx {Loadable Function} {[@dots{}] =} lu (@var{s}, @var{thres})\n\ @@ -133,7 +134,7 @@ With one output argument @var{y}, then the matrix returned by the @sc{lapack}\n\ routines is returned. If the input matrix is sparse then the matrix @var{l}\n\ is embedded into @var{u} to give a return value similar to the full case.\n\ -For both full and sparse matrices, @dfn{lu} looses the permutation\n\ +For both full and sparse matrices, @dfn{lu} loses the permutation\n\ information.\n\ @end deftypefn") { diff --git a/src/DLD-FUNCTIONS/rand.cc b/src/DLD-FUNCTIONS/rand.cc --- a/src/DLD-FUNCTIONS/rand.cc +++ b/src/DLD-FUNCTIONS/rand.cc @@ -311,7 +311,7 @@ DEFUN_DLD (rand, args, , "-*- texinfo -*-\n\ -@deftypefn {Loadable Function} {} rand (@var{x})\n\ +@deftypefn {Loadable Function} {} rand (@var{x})\n\ @deftypefnx {Loadable Function} {} rand (@var{n}, @var{m})\n\ @deftypefnx {Loadable Function} {} rand (\"state\", @var{x})\n\ @deftypefnx {Loadable Function} {} rand (\"seed\", @var{x})\n\ @@ -471,11 +471,11 @@ DEFUN_DLD (randn, args, , "-*- texinfo -*-\n\ -@deftypefn {Loadable Function} {} randn (@var{x})\n\ +@deftypefn {Loadable Function} {} randn (@var{x})\n\ @deftypefnx {Loadable Function} {} randn (@var{n}, @var{m})\n\ @deftypefnx {Loadable Function} {} randn (\"state\", @var{x})\n\ @deftypefnx {Loadable Function} {} randn (\"seed\", @var{x})\n\ -Return a matrix with normally distributed pseudo-random\n\ +Return a matrix with normally distributed random\n\ elements having zero mean and variance one. The arguments are\n\ handled the same as the arguments for @code{rand}.\n\ \n\ @@ -544,7 +544,7 @@ DEFUN_DLD (rande, args, , "-*- texinfo -*-\n\ -@deftypefn {Loadable Function} {} rande (@var{x})\n\ +@deftypefn {Loadable Function} {} rande (@var{x})\n\ @deftypefnx {Loadable Function} {} rande (@var{n}, @var{m})\n\ @deftypefnx {Loadable Function} {} rande (\"state\", @var{x})\n\ @deftypefnx {Loadable Function} {} rande (\"seed\", @var{x})\n\ @@ -617,7 +617,7 @@ DEFUN_DLD (randg, args, , "-*- texinfo -*-\n\ -@deftypefn {Loadable Function} {} randg (@var{a}, @var{x})\n\ +@deftypefn {Loadable Function} {} randg (@var{a}, @var{x})\n\ @deftypefnx {Loadable Function} {} randg (@var{a}, @var{n}, @var{m})\n\ @deftypefnx {Loadable Function} {} randg (\"state\", @var{x})\n\ @deftypefnx {Loadable Function} {} randg (\"seed\", @var{x})\n\ @@ -867,11 +867,12 @@ DEFUN_DLD (randp, args, , "-*- texinfo -*-\n\ -@deftypefn {Loadable Function} {} randp (@var{l}, @var{x})\n\ +@deftypefn {Loadable Function} {} randp (@var{l}, @var{x})\n\ @deftypefnx {Loadable Function} {} randp (@var{l}, @var{n}, @var{m})\n\ @deftypefnx {Loadable Function} {} randp (\"state\", @var{x})\n\ @deftypefnx {Loadable Function} {} randp (\"seed\", @var{x})\n\ -Return a matrix with Poisson distributed random elements with mean value parameter given by the first argument, @var{l}. The arguments\n\ +Return a matrix with Poisson distributed random elements with mean value\n\ +parameter given by the first argument, @var{l}. The arguments\n\ are handled the same as the arguments for @code{rand}, except for the\n\ argument @var{l}.\n\ \n\ @@ -1013,7 +1014,7 @@ DEFUN_DLD (randperm, args, , "-*- texinfo -*-\n\ -@deftypefn {Loadable Function} {} randperm (@var{n})\n\ +@deftypefn {Loadable Function} {} randperm (@var{n})\n\ @deftypefnx {Loadable Function} {} randperm (@var{n}, @var{m})\n\ Return a row vector containing a random permutation of @code{1:@var{n}}.\n\ If @var{m} is supplied, return @var{m} permutations,\n\ diff --git a/src/DLD-FUNCTIONS/svd.cc b/src/DLD-FUNCTIONS/svd.cc --- a/src/DLD-FUNCTIONS/svd.cc +++ b/src/DLD-FUNCTIONS/svd.cc @@ -42,8 +42,9 @@ DEFUN_DLD (svd, args, nargout, "-*- texinfo -*-\n\ -@deftypefn {Loadable Function} {@var{s} =} svd (@var{a})\n\ +@deftypefn {Loadable Function} {@var{s} =} svd (@var{a})\n\ @deftypefnx {Loadable Function} {[@var{u}, @var{s}, @var{v}] =} svd (@var{a})\n\ +@deftypefnx {Loadable Function} {[@var{u}, @var{s}, @var{v}] =} svd (@var{a}, @var{econ})\n\ @cindex singular value decomposition\n\ Compute the singular value decomposition of @var{a}\n\ @tex\n\ @@ -58,8 +59,8 @@ @end example\n\ @end ifnottex\n\ \n\ -The function @code{svd} normally returns the vector of singular values.\n\ -If asked for three return values, it computes\n\ +The function @code{svd} normally returns only the vector of singular values.\n\ +When called with three return values, it computes\n\ @tex\n\ $U$, $S$, and $V$.\n\ @end tex\n\ diff --git a/src/DLD-FUNCTIONS/tril.cc b/src/DLD-FUNCTIONS/tril.cc --- a/src/DLD-FUNCTIONS/tril.cc +++ b/src/DLD-FUNCTIONS/tril.cc @@ -339,7 +339,11 @@ DEFUN_DLD (tril, args, , "-*- texinfo -*-\n\ -@deftypefn {Function File} {} tril (@var{a}, @var{k}, @var{pack})\n\ +@deftypefn {Function File} {} tril (@var{a})\n\ +@deftypefnx {Function File} {} tril (@var{a}, @var{k})\n\ +@deftypefnx {Function File} {} tril (@var{a}, @var{k}, @var{pack})\n\ +@deftypefnx {Function File} {} triu (@var{a})\n\ +@deftypefnx {Function File} {} triu (@var{a}, @var{k})\n\ @deftypefnx {Function File} {} triu (@var{a}, @var{k}, @var{pack})\n\ Return a new matrix formed by extracting extract the lower (@code{tril})\n\ or upper (@code{triu}) triangular part of the matrix @var{a}, and\n\ diff --git a/src/data.cc b/src/data.cc --- a/src/data.cc +++ b/src/data.cc @@ -1874,7 +1874,7 @@ DEFUN (length, args, , "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} length (@var{a})\n\ -Return the `length' of the object @var{a}. For matrix objects, the\n\ +Return the \"length\" of the object @var{a}. For matrix objects, the\n\ length is the number of rows or columns, whichever is greater (this\n\ odd definition is used for compatibility with @sc{matlab}).\n\ @end deftypefn") @@ -1892,9 +1892,13 @@ DEFUN (ndims, args, , "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} ndims (@var{a})\n\ -Returns the number of dimensions of array @var{a}.\n\ +Return the number of dimensions of @var{a}.\n\ For any array, the result will always be larger than or equal to 2.\n\ Trailing singleton dimensions are not counted.\n\ +@example\n\ + ndims (ones (4, 1, 2, 1)\n\ + @result{} 3\n\ +@end example\n\ @end deftypefn") { octave_value retval; @@ -1909,9 +1913,9 @@ DEFUN (numel, args, , "-*- texinfo -*-\n\ -@deftypefn {Built-in Function} {} numel (@var{a})\n\ +@deftypefn {Built-in Function} {} numel (@var{a})\n\ @deftypefnx {Built-in Function} {} numel (@var{a}, @var{idx1}, @var{idx2}, @dots{})\n\ -Returns the number of elements in the object @var{a}.\n\ +Return the number of elements in the object @var{a}.\n\ Optionally, if indices @var{idx1}, @var{idx2}, @dots{} are supplied,\n\ return the number of elements that would result from the indexing\n\ @example\n\ @@ -1941,7 +1945,8 @@ DEFUN (size, args, nargout, "-*- texinfo -*-\n\ -@deftypefn {Built-in Function} {} size (@var{a}, @var{n})\n\ +@deftypefn {Built-in Function} {} size (@var{a})\n\ +@deftypefnx {Built-in Function} {} size (@var{a}, @var{dim})\n\ Return the number rows and columns of @var{a}.\n\ \n\ With one input argument and one output argument, the result is returned\n\ @@ -2105,7 +2110,7 @@ "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} rows (@var{a})\n\ Return the number of rows of @var{a}.\n\ -@seealso{size, numel, columns, length, isscalar, isvector, ismatrix}\n\ +@seealso{columns, size, length, numel, isscalar, isvector, ismatrix}\n\ @end deftypefn") { octave_value retval; @@ -2122,7 +2127,7 @@ "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} columns (@var{a})\n\ Return the number of columns of @var{a}.\n\ -@seealso{size, numel, rows, length, isscalar, isvector, ismatrix}\n\ +@seealso{rows, size, length, numel, isscalar, isvector, ismatrix}\n\ @end deftypefn") { octave_value retval; @@ -3287,7 +3292,7 @@ DEFUN (ones, args, , "-*- texinfo -*-\n\ -@deftypefn {Built-in Function} {} ones (@var{x})\n\ +@deftypefn {Built-in Function} {} ones (@var{x})\n\ @deftypefnx {Built-in Function} {} ones (@var{n}, @var{m})\n\ @deftypefnx {Built-in Function} {} ones (@var{n}, @var{m}, @var{k}, @dots{})\n\ @deftypefnx {Built-in Function} {} ones (@dots{}, @var{class})\n\ @@ -3304,12 +3309,13 @@ val_matrix = val * ones (n, m)\n\ @end example\n\ \n\ -The optional argument @var{class}, allows @code{ones} to return an array of\n\ -the specified type, for example\n\ +The optional argument @var{class} specifies the class of the return array\n\ +and defaults to double. For example\n\ \n\ @example\n\ val = ones (n,m, \"uint8\")\n\ @end example\n\ +@seealso{zeros}\n\ @end deftypefn") { return fill_matrix (args, 1, "ones"); @@ -3336,19 +3342,23 @@ DEFUN (zeros, args, , "-*- texinfo -*-\n\ -@deftypefn {Built-in Function} {} zeros (@var{x})\n\ +@deftypefn {Built-in Function} {} zeros (@var{x})\n\ @deftypefnx {Built-in Function} {} zeros (@var{n}, @var{m})\n\ @deftypefnx {Built-in Function} {} zeros (@var{n}, @var{m}, @var{k}, @dots{})\n\ @deftypefnx {Built-in Function} {} zeros (@dots{}, @var{class})\n\ Return a matrix or N-dimensional array whose elements are all 0.\n\ -The arguments are handled the same as the arguments for @code{ones}.\n\ +If invoked with a single scalar integer argument, return a square\n\ +matrix of the specified size. If invoked with two or more scalar\n\ +integer arguments, or a vector of integer values, return an array with\n\ +given dimensions.\n\ \n\ -The optional argument @var{class}, allows @code{zeros} to return an array of\n\ -the specified type, for example\n\ +The optional argument @var{class} specifies the class of the return array\n\ +and defaults to double. For example\n\ \n\ @example\n\ val = zeros (n,m, \"uint8\")\n\ @end example\n\ +@seealso{ones}\n\ @end deftypefn") { return fill_matrix (args, 0, "zeros"); @@ -3814,11 +3824,15 @@ DEFUN (false, args, , "-*- texinfo -*-\n\ -@deftypefn {Built-in Function} {} false (@var{x})\n\ +@deftypefn {Built-in Function} {} false (@var{x})\n\ @deftypefnx {Built-in Function} {} false (@var{n}, @var{m})\n\ @deftypefnx {Built-in Function} {} false (@var{n}, @var{m}, @var{k}, @dots{})\n\ Return a matrix or N-dimensional array whose elements are all logical 0.\n\ -The arguments are handled the same as the arguments for @code{ones}.\n\ +If invoked with a single scalar integer argument, return a square\n\ +matrix of the specified size. If invoked with two or more scalar\n\ +integer arguments, or a vector of integer values, return an array with\n\ +given dimensions.\n\ +@seealso{true}\n\ @end deftypefn") { return fill_matrix (args, false, "false"); @@ -3826,11 +3840,15 @@ DEFUN (true, args, , "-*- texinfo -*-\n\ -@deftypefn {Built-in Function} {} true (@var{x})\n\ +@deftypefn {Built-in Function} {} true (@var{x})\n\ @deftypefnx {Built-in Function} {} true (@var{n}, @var{m})\n\ @deftypefnx {Built-in Function} {} true (@var{n}, @var{m}, @var{k}, @dots{})\n\ Return a matrix or N-dimensional array whose elements are all logical 1.\n\ -The arguments are handled the same as the arguments for @code{ones}.\n\ +If invoked with a single scalar integer argument, return a square\n\ +matrix of the specified size. If invoked with two or more scalar\n\ +integer arguments, or a vector of integer values, return an array with\n\ +given dimensions.\n\ +@seealso{false}\n\ @end deftypefn") { return fill_matrix (args, true, "true"); @@ -4452,7 +4470,9 @@ DEFUN (norm, args, , "-*- texinfo -*-\n\ -@deftypefn {Built-in Function} {} norm (@var{a}, @var{p}, @var{opt})\n\ +@deftypefn {Built-in Function} {} norm (@var{a})\n\ +@deftypefnx {Built-in Function} {} norm (@var{a}, @var{p})\n\ +@deftypefnx {Built-in Function} {} norm (@var{a}, @var{p}, @var{opt})\n\ Compute the p-norm of the matrix @var{a}. If the second argument is\n\ missing, @code{p = 2} is assumed.\n\ \n\ @@ -4500,9 +4520,10 @@ the p-pseudonorm defined as above.\n\ @end table\n\ \n\ -If @code{\"rows\"} is given as @var{opt}, the norms of all rows of the matrix @var{a} are\n\ -returned as a column vector. Similarly, if @code{\"columns\"} or @code{\"cols\"} is passed\n\ -column norms are computed.\n\ +If @var{opt} is the value @code{\"rows\"}, treat each row as a vector and\n\ +compute its norm. The result is returned as a column vector.\n\ +Similarly, if @var{opt} is @code{\"columns\"} or @code{\"cols\"} then compute\n\ +the norms of each column and return a row vector.\n\ @seealso{cond, svd}\n\ @end deftypefn") { diff --git a/src/ov.cc b/src/ov.cc --- a/src/ov.cc +++ b/src/ov.cc @@ -2672,7 +2672,8 @@ DEFUN (sizeof, args, , "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} sizeof (@var{val})\n\ -Return the size of @var{val} in bytes\n\ +Return the size of @var{val} in bytes.\n\ +@seealso{whos}\n\ @end deftypefn") { octave_value retval;