# HG changeset patch # User jwe # Date 943118581 0 # Node ID a4cd1e9d9962f2602d897aa8ddb5822ca7e7e15f # Parent 0748b03c351093eaa34099e1ca740ac7fac176a5 [project @ 1999-11-20 17:22:48 by jwe] diff -r 0748b03c3510 -r a4cd1e9d9962 doc/interpreter/basics.txi --- a/doc/interpreter/basics.txi Sat Nov 20 14:52:42 1999 +0000 +++ b/doc/interpreter/basics.txi Sat Nov 20 17:23:01 1999 +0000 @@ -556,12 +556,7 @@ @DOCSTRING(run_history) -@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 +@DOCSTRING(EDITOR) @DOCSTRING(history_file) diff -r 0748b03c3510 -r a4cd1e9d9962 doc/interpreter/control.txi --- a/doc/interpreter/control.txi Sat Nov 20 14:52:42 1999 +0000 +++ b/doc/interpreter/control.txi Sat Nov 20 17:23:01 1999 +0000 @@ -369,10 +369,6 @@ @DOCSTRING(pzmap) -@deftypefn{Function File} {outputs = } synKnames (inputs) -Return controller signal names based in plant signal names and dimensions -@end deftypefn - @DOCSTRING(is_abcd) @DOCSTRING(is_controllable) @@ -455,54 +451,6 @@ @DOCSTRING(hinfsyn) -@DOCSTRING(hinfsyn_c) -@deftypefn {Function File } {[@var{xx}, @var{err}] =} hinfsyn_c (@var{nn}, @var{ptol}, @var{s1}@{, @var{s2}@}) -used internally in hinfsyn to evaluate hamiltonian/symplectic - eigenvalue problems. - -@strong{WARNING} Argument checking not performed. - -@strong{Inputs} -@table @var -@item s1 @r{(alone)} -hamiltonian matrix -@item (s1,s2) @r{ as a pair} -symplectic matrix pencil -@end table -@strong{Outputs} -@table @var -@item xx: positive (semi-)definite solution of DARE (set to 0 if err <=2) -@item code: error: -@table @strong -@item 0 -no error -@item 1 - (s1): eigenvalues on imaginary axis - - (s1,s2): gen. eigenvalues on unit circle -@item 2 - unequal number of stable/antistable (generalized) eigenvalues -@item 3 -(s1): infinite entries in solution x - -(s1,s2): infinite entires in solution x or (I + R X) singular -@item 4 -x is not symmetric -@item 5 -x has negative eigenvalues -@end table -@end table - -Solution method: Either Laub's schur method or Symplectic GEP approach; -uses Van Dooren's code to re-order qz decompostion -(www.netlib.com - toms/590) - -See also: Ran and Rodman, "Stable Hermitian Solutions of Discrete - Algebraic Riccati Equations," Mathematics of Control, Signals and - Systems, Vol 5, no 2 (1992) pp 165-194. - -@end deftypefn - @DOCSTRING(hinfsyn_chk) @DOCSTRING(lqe) @@ -520,14 +468,6 @@ @DOCSTRING(axis2dlim) -@deftypefn {Function File } { outputs =} mb ( inputs ) -@format - $Revision: 1.9 $ - - -@end format -@end deftypefn - @DOCSTRING(moddemo) @DOCSTRING(prompt) diff -r 0748b03c3510 -r a4cd1e9d9962 doc/interpreter/nonlin.txi --- a/doc/interpreter/nonlin.txi Sat Nov 20 14:52:42 1999 +0000 +++ b/doc/interpreter/nonlin.txi Sat Nov 20 17:23:01 1999 +0000 @@ -26,19 +26,9 @@ using the function @code{fsolve}, which is based on the @sc{Minpack} subroutine @code{hybrd}. -@deftypefn {Loadable Function} {[@var{x}, @var{info}] =} 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}. -@end deftypefn +@DOCSTRING(fsolve) -@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. -@end deftypefn +@DOCSTRING(fsolve_options) Here is a complete example. To solve the set of equations @iftex diff -r 0748b03c3510 -r a4cd1e9d9962 doc/interpreter/optim.txi --- a/doc/interpreter/optim.txi Sat Nov 20 14:52:42 1999 +0000 +++ b/doc/interpreter/optim.txi Sat Nov 20 17:23:01 1999 +0000 @@ -28,101 +28,6 @@ @node Linear Least Squares, , Nonlinear Programming, Optimization @section Linear Least Squares -@deftypefn {Function File} {[@var{beta}, @var{v}, @var{r}] =} gls (@var{y}, @var{x}, @var{o}) -Generalized least squares estimation for the multivariate model -@iftex -@tex -$y = x b + e$ -with $\bar{e} = 0$ and cov(vec($e$)) = $(s^2)o$, -@end tex -@end iftex -@ifinfo -@code{@var{y} = @var{x} * @var{b} + @var{e}} with @code{mean (@var{e}) = -0} and @code{cov (vec (@var{e})) = (@var{s}^2)*@var{o}}, -@end ifinfo - where -@iftex -@tex -$y$ is a $t \times p$ matrix, $x$ is a $t \times k$ matrix, $b$ is a $k -\times p$ matrix, $e$ is a $t \times p$ matrix, and $o$ is a $tp \times -tp$ matrix. -@end tex -@end iftex -@ifinfo -@var{Y} is a @var{T} by @var{p} matrix, @var{X} is a @var{T} by @var{k} -matrix, @var{B} is a @var{k} by @var{p} matrix, @var{E} is a @var{T} by -@var{p} matrix, and @var{O} is a @var{T}@var{p} by @var{T}@var{p} -matrix. -@end ifinfo - -@noindent -Each row of Y and X is an observation and each column a variable. - -The return values @var{beta}, @var{v}, and @var{r} are defined as -follows. - -@table @var -@item beta -The GLS estimator for @var{b}. - -@item v -The GLS estimator for @code{@var{s}^2}. - -@item r -The matrix of GLS residuals, @code{@var{r} = @var{y} - @var{x} * -@var{beta}}. -@end table -@end deftypefn +@DOCSTRING(gls) -@deftypefn {Function File} {[@var{beta}, @var{sigma}, @var{r}] =} ols (@var{y}, @var{x}) -Ordinary least squares estimation for the multivariate model -@iftex -@tex -$y = x b + e$ -with -$\bar{e} = 0$, and cov(vec($e$)) = kron ($s, I$) -@end tex -@end iftex -@ifinfo -@code{@var{y} = @var{x}*@var{b} + @var{e}} with -@code{mean (@var{e}) = 0} and @code{cov (vec (@var{e})) = kron (@var{s}, -@var{I})}. -@end ifinfo - where -@iftex -@tex -$y$ is a $t \times p$ matrix, $x$ is a $t \times k$ matrix, -$b$ is a $k \times p$ matrix, and $e$ is a $t \times p$ matrix. -@end tex -@end iftex -@ifinfo -@var{y} is a @var{t} by @var{p} matrix, @var{X} is a @var{t} by @var{k} -matrix, @var{B} is a @var{k} by @var{p} matrix, and @var{e} is a @var{t} -by @var{p} matrix. -@end ifinfo - -Each row of @var{y} and @var{x} is an observation and each column a -variable. - -The return values @var{beta}, @var{sigma}, and @var{r} are defined as -follows. - -@table @var -@item beta -The OLS estimator for @var{b}, @code{@var{beta} = pinv (@var{x}) * -@var{y}}, where @code{pinv (@var{x})} denotes the pseudoinverse of -@var{x}. - -@item sigma -The OLS estimator for the matrix @var{s}, - -@example -@group -@var{sigma} = (@var{y}-@var{x}*@var{beta})' * (@var{y}-@var{x}*@var{beta}) / (@var{t}-rank(@var{x})) -@end group -@end example - -@item r -The matrix of OLS residuals, @code{@var{r} = @var{y} - @var{x} * @var{beta}}. -@end table -@end deftypefn +@DOCSTRING(ols) diff -r 0748b03c3510 -r a4cd1e9d9962 doc/interpreter/plot.txi --- a/doc/interpreter/plot.txi Sat Nov 20 14:52:42 1999 +0000 +++ b/doc/interpreter/plot.txi Sat Nov 20 17:23:01 1999 +0000 @@ -162,12 +162,7 @@ any arguments. @end deffn -@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. Since this is fairly -inefficient, the default value is 0. -@end defvr +@DOCSTRING(automatic_replot) Note that NaN values in the plot data are automatically omitted, and Inf values are converted to a very large value before calling gnuplot. @@ -183,308 +178,38 @@ @cindex plotting @cindex graphics -@deftypefn {Function File} {} plot (@var{args}) -This function produces two-dimensional plots. Many different -combinations of arguments are possible. The simplest form is - -@example -plot (@var{y}) -@end example - -@noindent -where the argument is taken as the set of @var{y} coordinates and the -@var{x} coordinates are taken to be the indices of the elements, -starting with 1. - -If more than one argument is given, they are interpreted as - -@example -plot (@var{x}, @var{y}, @var{fmt} ...) -@end example - -@noindent -where @var{y} and @var{fmt} are optional, and any number of argument -sets may appear. The @var{x} and @var{y} values are -interpreted as follows: - -@itemize @bullet -@item -If a single data argument is supplied, it is taken as the set of @var{y} -coordinates and the @var{x} coordinates are taken to be the indices of -the elements, starting with 1. - -@item -If the first argument is a vector and the second is a matrix, the -the vector is plotted versus the columns (or rows) of the matrix. -(using whichever combination matches, with columns tried first.) - -@item -If the first argument is a matrix and the second is a vector, the -the columns (or rows) of the matrix are plotted versus the vector. -(using whichever combination matches, with columns tried first.) - -@item -If both arguments are vectors, the elements of @var{y} are plotted versus -the elements of @var{x}. +@DOCSTRING(plot) -@item -If both arguments are matrices, the columns of @var{y} are plotted -versus the columns of @var{x}. In this case, both matrices must have -the same number of rows and columns and no attempt is made to transpose -the arguments to make the number of rows match. - -If both arguments are scalars, a single point is plotted. -@end itemize - -The @var{fmt} argument, if present is interpreted as follows. If -@var{fmt} is missing, the default gnuplot line style is assumed. - -@table @samp -@item - -Set lines plot style (default). - -@item . -Set dots plot style. - -@item @@ -Set points plot style. - -@item -@@ -Set linespoints plot style. +@DOCSTRING(hold) -@item ^ -Set impulses plot style. - -@item L -Set steps plot style. - -@item # -Set boxes plot style. - -@item ~ -Set errorbars plot style. - -@item #~ -Set boxerrorbars plot style. - -@item @var{n} -Interpreted as the plot color if @var{n} is an integer in the range 1 to -6. - -@item @var{nm} -If @var{nm} is a two digit integer and @var{m} is an integer in the -range 1 to 6, @var{m} is interpreted as the point style. This is only -valid in combination with the @code{@@} or @code{-@@} specifiers. - -@item @var{c} -If @var{c} is one of @code{"r"}, @code{"g"}, @code{"b"}, @code{"m"}, -@code{"c"}, or @code{"w"}, it is interpreted as the plot color (red, -green, blue, magenta, cyan, or white). +@DOCSTRING(ishold) -@item + -@itemx * -@itemx o -@itemx x -Used in combination with the points or linespoints styles, set the point -style. -@end table - -The color line styles have the following meanings on terminals that -support color. - -@example -Number Gnuplot colors (lines)points style - 1 red * - 2 green + - 3 blue o - 4 magenta x - 5 cyan house - 6 brown there exists -@end example - -Here are some plot examples: +@DOCSTRING(clearplot) -@example -plot (x, y, "@@12", x, y2, x, y3, "4", x, y4, "+") -@end example - -This command will plot @code{y} with points of type 2 (displayed as -@samp{+}) and color 1 (red), @code{y2} with lines, @code{y3} with lines of -color 4 (magenta) and @code{y4} with points displayed as @samp{+}. - -@example -plot (b, "*") -@end example - -This command will plot the data in the variable @code{b} will be plotted -with points displayed as @samp{*}. -@end deftypefn - -@deftypefn {Function File} {} 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 +@DOCSTRING(closeplot) -@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 - -@deftypefn {Function File} {} 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 - -@deftypefn {Function File} {} clearplot -@deftypefnx {Function File} {} 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 - -@deftypefn {Function File} {} closeplot -Close stream to the @code{gnuplot} subprocess. If you are using X11, -this will close the plot window. -@end deftypefn +@DOCSTRING(purge_tmp_files) -@deftypefn {Function File} {} 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 - -@deftypefn {Function File} {} axis (@var{limits}) -Sets the axis limits for plots. - -The argument @var{limits} should be a 2, 4, or 6 element vector. The -first and second elements specify the lower and upper limits for the x -axis. The third and fourth specify the limits for the y axis, and the -fifth and sixth specify the limits for the z axis. - -With no arguments, @code{axis} turns autoscaling on. - -If your plot is already drawn, then you need to use @code{replot} before -the new axis limits will take effect. You can get this to happen -automatically by setting the built-in variable @code{automatic_replot} -to a nonzero value. -@end deftypefn +@DOCSTRING(axis) @node Specialized Two-Dimensional Plots, Three-Dimensional Plotting, Two-Dimensional Plotting, Plotting @section Specialized Two-Dimensional Plots -@deftypefn {Function File} {} bar (@var{x}, @var{y}) -Given two vectors of x-y data, @code{bar} produces a bar graph. - -If only one argument is given, it is taken as a vector of y-values -and the x coordinates are taken to be the indices of the elements. - -If two output arguments are specified, the data are generated but -not plotted. For example, +@DOCSTRING(bar) -@example -bar (x, y); -@end example - -@noindent -and - -@example -[xb, yb] = bar (x, y); -plot (xb, yb); -@end example +@DOCSTRING(contour) -@noindent -are equivalent. -@end deftypefn - -@deftypefn {Function File} {} contour (@var{z}, @var{n}, @var{x}, @var{y}) -Make a contour plot of the three-dimensional surface described by -@var{z}. Someone needs to improve @code{gnuplot}'s contour routines -before this will be very useful. -@end deftypefn +@DOCSTRING(hist) -@deftypefn {Function File} {} hist (@var{y}, @var{x}) -Produce histogram counts or plots. - -With one vector input argument, plot a histogram of the values with -10 bins. The range of the histogram bins is determined by the range -of the data. - -Given a second scalar argument, use that as the number of bins. - -Given a second vector argument, use that as the centers of the bins, -with the width of the bins determined from the adjacent values in -the vector. - -Extreme values are lumped in the first and last bins. +@DOCSTRING(loglog) -With two output arguments, produce the values @var{nn} and @var{xx} such -that @code{bar (@var{xx}, @var{nn})} will plot the histogram. -@end deftypefn - -@deftypefn {Function File} {} loglog (@var{args}) -Make a two-dimensional plot using log scales for both axes. See the -description of @code{plot} above for a description of the arguments that -@code{loglog} will accept. -@end deftypefn +@DOCSTRING(polar) -@deftypefn {Function File} {} polar (@var{theta}, @var{rho}) -Make a two-dimensional plot given polar the coordinates @var{theta} and -@var{rho}. -@end deftypefn - -@deftypefn {Function File} {} semilogx (@var{args}) -Make a two-dimensional plot using a log scale for the @var{x} axis. See -the description of @code{plot} above for a description of the arguments -that @code{semilogx} will accept. -@end deftypefn +@DOCSTRING(semilogx) -@deftypefn {Function File} {} semilogy (@var{args}) -Make a two-dimensional plot using a log scale for the @var{y} axis. See -the description of @code{plot} above for a description of the arguments -that @code{semilogy} will accept. -@end deftypefn - -@deftypefn {Function File} {} stairs (@var{x}, @var{y}) -Given two vectors of x-y data, bar produces a `stairstep' plot. - -If only one argument is given, it is taken as a vector of y-values -and the x coordinates are taken to be the indices of the elements. - -If two output arguments are specified, the data are generated but -not plotted. For example, +@DOCSTRING(semilogy) -@example -stairs (x, y); -@end example - -@noindent -and - -@example -[xs, ys] = stairs (x, y); -plot (xs, ys); -@end example - -@noindent -are equivalent. -@end deftypefn +@DOCSTRING(stairs) @node Three-Dimensional Plotting, Plot Annotations, Specialized Two-Dimensional Plots, Plotting @section Three-Dimensional Plotting @@ -563,66 +288,26 @@ The @sc{Matlab}-style three-dimensional plotting commands are: -@deftypefn {Function File} {} mesh (@var{x}, @var{y}, @var{z}) -Plot a mesh given matrices @code{x}, and @var{y} from @code{meshdom} and -a matrix @var{z} corresponding to the @var{x} and @var{y} coordinates of -the mesh. -@end deftypefn +@DOCSTRING(mesh) -@deftypefn {Function File} {} meshdom (@var{x}, @var{y}) -Given vectors of @var{x} and @var{y} coordinates, return two matrices -corresponding to the @var{x} and @var{y} coordinates of the mesh. +@DOCSTRING(meshdom) -See the file @file{sombrero.m} for an example of using @code{mesh} and -@code{meshdom}. -@end deftypefn - -@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 +@DOCSTRING(gnuplot_binary) -@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 +@DOCSTRING(gnuplot_has_frames) -@deftypefn {Function File} {} figure (@var{n}) -Set the current plot window to plot window @var{n}. This function -currently requires X11 and a version of gnuplot that supports multiple -frames. -@end deftypefn +@DOCSTRING(figure) -@defvr {Built-in Variable} gnuplot_has_multiplot -If the value of this variable is nonzero, Octave assumes that your copy -of gnuplot has the multiplot support 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 +@DOCSTRING(gnuplot_has_multiplot) @node Plot Annotations, Multiple Plots on One Page, Three-Dimensional Plotting, Plotting @section Plot Annotations -@deftypefn {Function File} {} grid -For two-dimensional plotting, force the display of a grid on the plot. -@end deftypefn +@DOCSTRING(grid) -@deftypefn {Function File} {} title (@var{string}) -Specify a title for the plot. If you already have a plot displayed, use -the command @code{replot} to redisplay it with the new title. -@end deftypefn +@DOCSTRING(title) -@deftypefn {Function File} {} xlabel (@var{string}) -@deftypefnx {Function File} {} ylabel (@var{string}) -@deftypefnx {Function File} {} zlabel (@var{string}) -Specify x, y, and z axis labels for the plot. If you already have a plot -displayed, use the command @code{replot} to redisplay it with the new -labels. -@end deftypefn +@DOCSTRING(xlabel) @node Multiple Plots on One Page, , Plot Annotations, Plotting @section Multiple Plots on One Page @@ -630,118 +315,16 @@ The following functions all require a version of @code{gnuplot} that supports the multiplot feature. -@deftypefn {Function File} {} mplot (@var{x}, @var{y}) -@deftypefnx {Function File} {} mplot (@var{x}, @var{y}, @var{fmt}) -@deftypefnx {Function File} {} mplot (@var{x1}, @var{y1}, @var{x2}, @var{y2}) -This is a modified version of the @code{plot} function that works with -the multiplot version of @code{gnuplot} to plot multiple plots per page. -This plot version automatically advances to the next subplot position -after each set of arguments are processed. - -See the description of the @var{plot} function for the various options. -@end deftypefn - -@deftypefn {Function File} {} multiplot (@var{xn}, @var{yn}) -Sets and resets multiplot mode. - -If the arguments are non-zero, @code{multiplot} will set up multiplot -mode with @var{xn}, @var{yn} subplots along the @var{x} and @var{y} -axes. If both arguments are zero, @code{multiplot} closes multiplot -mode. -@end deftypefn - -@deftypefn {Function File} {} oneplot () -If in multiplot mode, switches to single plot mode. -@end deftypefn - -@deftypefn {Function File} {} plot_border (...) -Multiple arguments allowed to specify the sides on which the border -is shown. Allowed arguments include: +@DOCSTRING(mplot) -@table @code -@item "blank" -No borders displayed. - -@item "all" -All borders displayed - -@item "north" -North Border - -@item "south" -South Border +@DOCSTRING(multiplot) -@item "east" -East Border - -@item "west" -West Border -@end table - -@noindent -The arguments may be abbreviated to single characters. Without any -arguments, @code{plot_border} turns borders off. -@end deftypefn - -@deftypefn {Function File} {} subplot (@var{rows}, @var{cols}, @var{index}) -@deftypefnx {Function File} {} subplot (@var{rcn}) -Sets @code{gnuplot} in multiplot mode and plots in location -given by index (there are @var{cols} by @var{rows} subwindows). +@DOCSTRING(oneplot) -Input: - -@table @var -@item rows -Number of rows in subplot grid. - -@item columns -Number of columns in subplot grid. +@DOCSTRING(plot_border) -@item index -Index of subplot where to make the next plot. -@end table - -If only one argument is supplied, then it must be a three digit value -specifying the location in digits 1 (rows) and 2 (columns) and the plot -index in digit 3. - -The plot index runs row-wise. First all the columns in a row are filled -and then the next row is filled. +@DOCSTRING(subplot) -For example, a plot with 4 by 2 grid will have plot indices running as -follows: -@iftex -@tex -\vskip 10pt -\hfil\vbox{\offinterlineskip\hrule -\halign{\vrule#&&\qquad\hfil#\hfil\qquad\vrule\cr -height13pt&1&2&3&4\cr height12pt&&&&\cr\noalign{\hrule} -height13pt&5&6&7&8\cr height12pt&&&&\cr\noalign{\hrule}}} -\hfil -\vskip 10pt -@end tex -@end iftex -@ifinfo -@display -@group -+-----+-----+-----+-----+ -| 1 | 2 | 3 | 4 | -+-----+-----+-----+-----+ -| 5 | 6 | 7 | 8 | -+-----+-----+-----+-----+ -@end group -@end display -@end ifinfo -@end deftypefn +@DOCSTRING(subwindow) -@deftypefn {Function File} {} subwindow (@var{xn}, @var{yn}) -Sets the subwindow position in multiplot mode for the next plot. The -multiplot mode has to be previously initialized using the -@code{multiplot} function, otherwise this command just becomes an alias -to @code{multiplot} -@end deftypefn - -@deftypefn {Function File} {} top_title (@var{string}) -@deftypefnx {Function File} {} bottom_title (@var{string}) -Makes a title with text @var{string} at the top (bottom) of the plot. -@end deftypefn +@DOCSTRING(top_title) diff -r 0748b03c3510 -r a4cd1e9d9962 doc/interpreter/poly.txi --- a/doc/interpreter/poly.txi Sat Nov 20 14:52:42 1999 +0000 +++ b/doc/interpreter/poly.txi Sat Nov 20 17:23:01 1999 +0000 @@ -37,223 +37,26 @@ @end example @end ifinfo -@deftypefn {Function File} {} compan (@var{c}) -Compute the companion matrix corresponding to polynomial coefficient -vector @var{c}. - -The companion matrix is -@iftex -@tex -$$ -A = \left[\matrix{ - -c_2/c_1 & -c_3/c_1 & \cdots & -c_N/c_1 & -c_{N+1}/c_1\cr - 1 & 0 & \cdots & 0 & 0 \cr - 0 & 1 & \cdots & 0 & 0 \cr - \vdots & \vdots & \ddots & \vdots & \vdots \cr - 0 & 0 & \cdots & 1 & 0}\right]. -$$ -@end tex -@end iftex -@ifinfo +@DOCSTRING(compan) -@smallexample - _ _ - | -c(2)/c(1) -c(3)/c(1) ... -c(N)/c(1) -c(N+1)/c(1) | - | 1 0 ... 0 0 | - | 0 1 ... 0 0 | -A = | . . . . . | - | . . . . . | - | . . . . . | - |_ 0 0 ... 1 0 _| -@end smallexample -@end ifinfo +@DOCSTRING(conv) -The eigenvalues of the companion matrix are equal to the roots of the -polynomial. -@end deftypefn - -@deftypefn {Function File} {} conv (@var{a}, @var{b}) -Convolve two vectors. - -@code{y = conv (a, b)} returns a vector of length equal to -@code{length (a) + length (b) - 1}. -If @var{a} and @var{b} are polynomial coefficient vectors, @code{conv} -returns the coefficients of the product polynomial. -@end deftypefn - -@deftypefn {Function File} {} deconv (@var{y}, @var{a}) -Deconvolve two vectors. - -@code{[b, r] = deconv (y, a)} solves for @var{b} and @var{r} such that -@code{y = conv (a, b) + r}. +@DOCSTRING(deconv) -If @var{y} and @var{a} are polynomial coefficient vectors, @var{b} will -contain the coefficients of the polynomial quotient and @var{r} will be -a remander polynomial of lowest order. -@end deftypefn - -@deftypefn {Function File} {} poly (@var{a}) -If @var{a} is a square @var{N}-by-@var{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}. 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}. -@end deftypefn - -@deftypefn {Function File} {} polyderiv (@var{c}) -Return the coefficients of the derivative of the polynomial whose -coefficients are given by vector @var{c}. -@end deftypefn +@DOCSTRING(poly) -@deftypefn {Function File} {[@var{p}, @var{yf}] =} polyfit (@var{x}, @var{y}, @var{n}) -Return the coefficients of a polynomial @var{p}(@var{x}) of degree -@var{n} that minimizes -@iftex -@tex -$$ -\sum_{i=1}^N (p(x_i) - y_i)^2 -$$ -@end tex -@end iftex -@ifinfo -@code{sumsq (p(x(i)) - y(i))}, -@end ifinfo - to best fit the data in the least squares sense. -@end deftypefn - -If two output arguments are requested, the second contains the values of -the polynomial for each value of @var{x}. +@DOCSTRING(polyderiv) -@deftypefn {Function File} {} polyinteg (@var{c}) -Return the coefficients of the integral of the polynomial whose -coefficients are represented by the vector @var{c}. - -The constant of integration is set to zero. -@end deftypefn - -@deftypefn {Function File} {} polyreduce (@var{c}) -Reduces a polynomial coefficient vector to a minimum number of terms by -stripping off any leading zeros. -@end deftypefn - -@deftypefn {Function File} {} polyval (@var{c}, @var{x}) -Evaluate a polynomial. - -@code{polyval (@var{c}, @var{x})} will evaluate the polynomial at the -specified value of @var{x}. - -If @var{x} is a vector or matrix, the polynomial is evaluated at each of -the elements of @var{x}. -@end deftypefn +@DOCSTRING(polyfit) -@deftypefn {Function File} {} polyvalm (@var{c}, @var{x}) -Evaluate a polynomial in the matrix sense. - -@code{polyvalm (@var{c}, @var{x})} will evaluate the polynomial in the -matrix sense, i.e. matrix multiplication is used instead of element by -element multiplication as is used in polyval. - -The argument @var{x} must be a square matrix. -@end deftypefn - -@deftypefn {Function File} {} residue (@var{b}, @var{a}, @var{tol}) -If @var{b} and @var{a} are vectors of polynomial coefficients, then -residue calculates the partial fraction expansion corresponding to the -ratio of the two polynomials. -@cindex partial fraction expansion - -The function @code{residue} returns @var{r}, @var{p}, @var{k}, and -@var{e}, where the vector @var{r} contains the residue terms, @var{p} -contains the pole values, @var{k} contains the coefficients of a direct -polynomial term (if it exists) and @var{e} is a vector containing the -powers of the denominators in the partial fraction terms. +@DOCSTRING(polyinteg) -Assuming @var{b} and @var{a} represent polynomials -@iftex -@tex -$P(s)$ and $Q(s)$ -@end tex -@end iftex -@ifinfo - P (s) and Q(s) -@end ifinfo - we have: -@iftex -@tex -$$ -{P(s)\over Q(s)} = \sum_{m=1}^M {r_m\over (s-p_m)^e_m} - + \sum_{i=1}^N k_i s^{N-i}. -$$ -@end tex -@end iftex -@ifinfo +@DOCSTRING(polyreduce) -@example - P(s) M r(m) N - ---- = SUM ------------- + SUM k(i)*s^(N-i) - Q(s) m=1 (s-p(m))^e(m) i=1 -@end example -@end ifinfo - -@noindent -where @var{M} is the number of poles (the length of the @var{r}, -@var{p}, and @var{e} vectors) and @var{N} is the length of the @var{k} -vector. +@DOCSTRING(polyval) -The argument @var{tol} is optional, and if not specified, a default -value of 0.001 is assumed. The tolerance value is used to determine -whether poles with small imaginary components are declared real. It is -also used to determine if two poles are distinct. If the ratio of the -imaginary part of a pole to the real part is less than @var{tol}, the -imaginary part is discarded. If two poles are farther apart than -@var{tol} they are distinct. For example, - -@example -@group - b = [1, 1, 1]; - a = [1, -5, 8, -4]; - [r, p, k, e] = residue (b, a); - @result{} r = [-2, 7, 3] - @result{} p = [2, 2, 1] - @result{} k = [](0x0) - @result{} e = [1, 2, 1] -@end group -@end example +@DOCSTRING(polyvalm) -@noindent -which implies the following partial fraction expansion -@iftex -@tex -$$ -{s^2+s+1\over s^3-5s^2+8s-4} = {-2\over s-2} + {7\over (s-2)^2} + {3\over s-1} -$$ -@end tex -@end iftex -@ifinfo - -@example - s^2 + s + 1 -2 7 3 - ------------------- = ----- + ------- + ----- - s^3 - 5s^2 + 8s - 4 (s-2) (s-2)^2 (s-1) -@end example -@end ifinfo -@end deftypefn +@DOCSTRING(residue) -@deftypefn {Function File} {} roots (@var{v}) - -For a vector @var{v} with @var{N} components, return -the roots of the polynomial -@iftex -@tex -$$ -v_1 z^{N-1} + \cdots + v_{N-1} z + v_N. -$$ -@end tex -@end iftex -@ifinfo - -@example -v(1) * z^(N-1) + ... + v(N-1) * z + v(N). -@end example -@end ifinfo -@end deftypefn +@DOCSTRING(roots) diff -r 0748b03c3510 -r a4cd1e9d9962 doc/interpreter/quad.txi --- a/doc/interpreter/quad.txi Sat Nov 20 14:52:42 1999 +0000 +++ b/doc/interpreter/quad.txi Sat Nov 20 17:23:01 1999 +0000 @@ -13,45 +13,9 @@ @node Functions of One Variable, Orthogonal Collocation, Quadrature, Quadrature @section Functions of One Variable -@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. +@DOCSTRING(quad) -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. -@end deftypefn - -@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. -@end deftypefn +@DOCSTRING(quad_options) Here is an example of using @code{quad} to integrate the function @iftex @@ -109,12 +73,7 @@ @node Orthogonal Collocation, , Functions of One Variable, Quadrature @section Orthogonal Collocation -@deftypefn {Loadable Function} {[@var{r}, @var{A}, @var{B}, @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 +@DOCSTRING(colloc) Here is an example of using @code{colloc} to generate weight matrices for solving the second order differential equation diff -r 0748b03c3510 -r a4cd1e9d9962 doc/interpreter/set.txi --- a/doc/interpreter/set.txi Sat Nov 20 14:52:42 1999 +0000 +++ b/doc/interpreter/set.txi Sat Nov 20 17:23:01 1999 +0000 @@ -8,50 +8,10 @@ Octave has a limited set of functions for managing sets of data, where a set is defined as a collection unique elements. -@deftypefn {Function File} {} create_set (@var{x}) -Return a row vector containing the unique values in @var{x}, sorted in -ascending order. For example, - -@example -@group -create_set ([ 1, 2; 3, 4; 4, 2 ]) - @result{} [ 1, 2, 3, 4 ] -@end group -@end example -@end deftypefn +@DOCSTRING(create_set) -@deftypefn {Function File} {} union (@var{x}, @var{y}) -Return the set of elements that are in either of the sets @var{x} and -@var{y}. For example, - -@example -@group -union ([ 1, 2, 4 ], [ 2, 3, 5 ]) - @result{} [ 1, 2, 3, 4, 5 ] -@end group -@end example -@end deftypefn +@DOCSTRING(union) -@deftypefn {Function File} {} intersection (@var{x}, @var{y}) -Return the set of elements that are in both sets @var{x} and @var{y}. -For example, - -@example -@group -intersection ([ 1, 2, 3 ], [ 2, 3, 5 ]) - @result{} [ 2, 3 ] -@end group -@end example -@end deftypefn +@DOCSTRING(intersection) -@deftypefn {Function File} {} complement (@var{x}, @var{y}) -Return the elements of set @var{y} that are not in set @var{x}. For -example, - -@example -@group -complement ([ 1, 2, 3 ], [ 2, 3, 5 ]) - @result{} 5 -@end group -@end example -@end deftypefn +@DOCSTRING(complement) diff -r 0748b03c3510 -r a4cd1e9d9962 scripts/ChangeLog --- a/scripts/ChangeLog Sat Nov 20 14:52:42 1999 +0000 +++ b/scripts/ChangeLog Sat Nov 20 17:23:01 1999 +0000 @@ -8,11 +8,48 @@ * statistics/base/kurtosis: Ditto. * statistics/base/mahalanobis: Ditto. * statistics/base/skewness: Ditto. + * statistics/base/gls.m: Ditto. + * statistics/base/ols.m: Ditto. * signal/detrend.m: Ditto. * signal/freqz.m: Ditto. * signal/sinc.m: Ditto. * signal/fftconv.m: Ditto. * signal/fftfilt.m: Ditto. + * set/create_set.m: Ditto. + * set/union.m: Ditto. + * set/intersection.m: Ditto. + * set/complement.m: Ditto. + * poly/compan.m: Ditto. + * poly/conv: Ditto. + * poly/deconv: Ditto. + * poly/poly: Ditto. + * poly/polyderiv: Ditto. + * poly/polyfit: Ditto. + * poly/polyinteg: Ditto. + * poly/polyreduce: Ditto. + * poly/polyval: Ditto. + * poly/polyvalm: Ditto. + * poly/residue: Ditto. + * poly/roots: Ditto. + * plot/top_title.m: Ditto + * plot/subwindow.m: Ditto + * plot/subplot.m: Ditto + * plot/plot_border.m: Ditto + * plot/oneplot.m: Ditto + * plot/multiplot.m: Ditto + * plot/mplot.m: Ditto + * plot/xlabel.m: Ditto + * plot/figure.m: Ditto + * plot/meshdom.m: Ditto + * plot/mesh.m: Ditto + * plot/stairs.m: Ditto + * plot/polar.m: Ditto + * plot/loglog.m: Ditto + * plot/hist.m: Ditto + * plot/contour.m: Ditto + * plot/bar.m: Ditto + * plot/axis.m: Ditto + * plot/plot.m: Ditto. 1999-11-19 John W. Eaton diff -r 0748b03c3510 -r a4cd1e9d9962 scripts/plot/axis.m --- a/scripts/plot/axis.m Sat Nov 20 14:52:42 1999 +0000 +++ b/scripts/plot/axis.m Sat Nov 20 17:23:01 1999 +0000 @@ -17,17 +17,22 @@ ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -## usage: axis () -## axis ([xmin, xmax]) -## axis ([xmin, xmax, ymin, ymax]) -## axis ([xmin, xmax, ymin, ymax, zmin, zmax]) -## -## Sets the axis limits. -## -## With no arguments, turns autoscaling on. -## -## If your plot is already drawn, then you need to REPLOT before -## the new axis limits will take effect. +## -*- texinfo -*- +## @deftypefn {Function File} {} axis (@var{limits}) +## Sets the axis limits for plots. +## +## The argument @var{limits} should be a 2, 4, or 6 element vector. The +## first and second elements specify the lower and upper limits for the x +## axis. The third and fourth specify the limits for the y axis, and the +## fifth and sixth specify the limits for the z axis. +## +## With no arguments, @code{axis} turns autoscaling on. +## +## If your plot is already drawn, then you need to use @code{replot} before +## the new axis limits will take effect. You can get this to happen +## automatically by setting the built-in variable @code{automatic_replot} +## to a nonzero value. +## @end deftypefn ## Author: jwe diff -r 0748b03c3510 -r a4cd1e9d9962 scripts/plot/bar.m --- a/scripts/plot/bar.m Sat Nov 20 14:52:42 1999 +0000 +++ b/scripts/plot/bar.m Sat Nov 20 17:23:01 1999 +0000 @@ -17,25 +17,32 @@ ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -## usage: [xb, yb] = bar (x, y) -## -## Given two vectors of x-y data, bar produces a `bar' graph. -## +## -*- texinfo -*- +## @deftypefn {Function File} {} bar (@var{x}, @var{y}) +## Given two vectors of x-y data, @code{bar} produces a bar graph. +## ## If only one argument is given, it is taken as a vector of y-values ## and the x coordinates are taken to be the indices of the elements. -## +## ## If two output arguments are specified, the data are generated but ## not plotted. For example, -## -## bar (x, y); -## +## +## @example +## bar (x, y); +## @end example +## +## @noindent ## and -## -## [xb, yb] = bar (x, y); -## plot (xb, yb); -## +## +## @example +## [xb, yb] = bar (x, y); +## plot (xb, yb); +## @end example +## +## @noindent ## are equivalent. -## +## @end deftypefn + ## See also: plot, semilogx, semilogy, loglog, polar, mesh, contour, ## stairs, gplot, gsplot, replot, xlabel, ylabel, title diff -r 0748b03c3510 -r a4cd1e9d9962 scripts/plot/contour.m --- a/scripts/plot/contour.m Sat Nov 20 14:52:42 1999 +0000 +++ b/scripts/plot/contour.m Sat Nov 20 17:23:01 1999 +0000 @@ -17,8 +17,13 @@ ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -## usage: contour (z, n, x, y) -## +## -*- texinfo -*- +## @deftypefn {Function File} {} contour (@var{z}, @var{n}, @var{x}, @var{y}) +## Make a contour plot of the three-dimensional surface described by +## @var{z}. Someone needs to improve @code{gnuplot}'s contour routines +## before this will be very useful. +## @end deftypefn + ## See also: plot, semilogx, semilogy, loglog, polar, mesh, contour, ## bar, stairs, gplot, gsplot, replot, xlabel, ylabel, title diff -r 0748b03c3510 -r a4cd1e9d9962 scripts/plot/figure.m --- a/scripts/plot/figure.m Sat Nov 20 14:52:42 1999 +0000 +++ b/scripts/plot/figure.m Sat Nov 20 17:23:01 1999 +0000 @@ -17,10 +17,12 @@ ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -## usage: figure (n) -## -## Set the current plot window to plot window N. This function -## currently requires X11 and a recent version of gnuplot. +## -*- texinfo -*- +## @deftypefn {Function File} {} figure (@var{n}) +## Set the current plot window to plot window @var{n}. This function +## currently requires X11 and a version of gnuplot that supports multiple +## frames. +## @end deftypefn ## Author: jwe diff -r 0748b03c3510 -r a4cd1e9d9962 scripts/plot/grid.m --- a/scripts/plot/grid.m Sat Nov 20 14:52:42 1999 +0000 +++ b/scripts/plot/grid.m Sat Nov 20 17:23:01 1999 +0000 @@ -17,12 +17,13 @@ ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -## usage: grid ("on" | "off") -## -## Turn grid lines on or off for plotting. -## -## If the argument is omitted, "on" is assumed. -## +## -*- texinfo -*- +## @deftypefn {Function File} {} grid (@var{arg}) +## For two-dimensional plotting, force the display of a grid on the plot. +## The argument may be either @code{"on"} or @code{"off"}. If it is +## omitted, @code{"on"} is assumed. +## @end deftypefn + ## See also: plot, semilogx, semilogy, loglog, polar, mesh, contour, ## bar, stairs, gplot, gsplot, replot, xlabel, ylabel, title diff -r 0748b03c3510 -r a4cd1e9d9962 scripts/plot/hist.m --- a/scripts/plot/hist.m Sat Nov 20 14:52:42 1999 +0000 +++ b/scripts/plot/hist.m Sat Nov 20 17:23:01 1999 +0000 @@ -17,25 +17,26 @@ ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -## usage: [NN, XX] = hist (Y, X) or hist (Y, X) -## +## -*- texinfo -*- +## @deftypefn {Function File} {} hist (@var{y}, @var{x}) ## Produce histogram counts or plots. -## +## ## With one vector input argument, plot a histogram of the values with ## 10 bins. The range of the histogram bins is determined by the range ## of the data. -## +## ## Given a second scalar argument, use that as the number of bins. -## +## ## Given a second vector argument, use that as the centers of the bins, -## with the width of the bins determened from the adjacent values in +## with the width of the bins determined from the adjacent values in ## the vector. -## +## ## Extreme values are lumped in the first and last bins. -## -## With two output arguments, produce the values NN and XX such that -## bar (XX, NN) will plot the histogram. -## +## +## With two output arguments, produce the values @var{nn} and @var{xx} such +## that @code{bar (@var{xx}, @var{nn})} will plot the histogram. +## @end deftypefn + ## See also: bar ## Author: jwe diff -r 0748b03c3510 -r a4cd1e9d9962 scripts/plot/loglog.m --- a/scripts/plot/loglog.m Sat Nov 20 14:52:42 1999 +0000 +++ b/scripts/plot/loglog.m Sat Nov 20 17:23:01 1999 +0000 @@ -17,15 +17,13 @@ ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -## usage: loglog (x, y) -## loglog (x1, y1, x2, y2, ...) -## loglog (x, y, fmt) -## -## Make a 2D plot of y versus x using a log scale for the x axis. -## -## See the help message for the plot command for a description of how -## the arguments are interpreted. -## +## -*- texinfo -*- +## @deftypefn {Function File} {} loglog (@var{args}) +## Make a two-dimensional plot using log scales for both axes. See the +## description of @code{plot} for a description of the arguments that +## @code{loglog} will accept. +## @end deftypefn + ## See also: plot, semilogy, loglog, polar, mesh, contour, bar, stairs, ## gplot, gsplot, replot, xlabel, ylabel, title diff -r 0748b03c3510 -r a4cd1e9d9962 scripts/plot/mesh.m --- a/scripts/plot/mesh.m Sat Nov 20 14:52:42 1999 +0000 +++ b/scripts/plot/mesh.m Sat Nov 20 17:23:01 1999 +0000 @@ -17,14 +17,16 @@ ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -## usage: mesh (x, y, z) -## -## Surface plot. If x, y, and z are matrices with the same dimensions, -## then corresponding elements represent vertices of the plot. If x and -## y are vectors, then a typical vertex is (x(j), y(i), z(i,j)). Thus, -## columns of z correspond to different x values and rows of z correspond -## to different y values. -## +## -*- texinfo -*- +## @deftypefn {Function File} {} mesh (@var{x}, @var{y}, @var{z}) +## Plot a mesh given matrices @code{x}, and @var{y} from @code{meshdom} and +## a matrix @var{z} corresponding to the @var{x} and @var{y} coordinates of +## the mesh. If @var{x} and @var{y} are vectors, then a typical vertex +## is (@var{x}(j), @var{y}(i), @var{z}(i,j)). Thus, columns of @var{z} +## correspond to different @var{x} values and rows of @var{z} correspond +## to different @var{y} values. +## @end deftypefn + ## See also: plot, semilogx, semilogy, loglog, polar, meshgrid, meshdom, ## contour, bar, stairs, gplot, gsplot, replot, xlabel, ylabel, title diff -r 0748b03c3510 -r a4cd1e9d9962 scripts/plot/meshdom.m --- a/scripts/plot/meshdom.m Sat Nov 20 14:52:42 1999 +0000 +++ b/scripts/plot/meshdom.m Sat Nov 20 17:23:01 1999 +0000 @@ -17,10 +17,17 @@ ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -## usage: [xx, yy] = meshdom (x, y) +## -*- texinfo -*- +## @deftypefn {Function File} {} meshdom (@var{x}, @var{y}) +## Given vectors of @var{x} and @var{y} coordinates, return two matrices +## corresponding to the @var{x} and @var{y} coordinates of the mesh. +## +## See the file @file{sombrero.m} for an example of using @code{mesh} and +## @code{meshdom}. ## ## Note: this function is provided for compatibility with older versions -## of Matlab. You should use meshgrid() instead. +## of @sc{Matlab}. You should use @code{meshgrid} instead. +## @end deftypefn ## Author: jwe diff -r 0748b03c3510 -r a4cd1e9d9962 scripts/plot/mplot.m --- a/scripts/plot/mplot.m Sat Nov 20 14:52:42 1999 +0000 +++ b/scripts/plot/mplot.m Sat Nov 20 17:23:01 1999 +0000 @@ -17,18 +17,17 @@ ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -## usage: mplot (x, y) -## mplot (x1, y1, x2, y2, ...) -## mplot (x, y, fmt) -## -## This is a modified version of plot() command to work with -## multiplot version of gnuplot to plot multiple plots per page. -## This plot version automatically updates the plot position to -## next plot position after making the plot in the given subplot -## position. -## -## See command plot() for the various options to this command -## as this is just mulitplot version of the same command. +## -*- texinfo -*- +## @deftypefn {Function File} {} mplot (@var{x}, @var{y}) +## @deftypefnx {Function File} {} mplot (@var{x}, @var{y}, @var{fmt}) +## @deftypefnx {Function File} {} mplot (@var{x1}, @var{y1}, @var{x2}, @var{y2}) +## This is a modified version of the @code{plot} function that works with +## the multiplot version of @code{gnuplot} to plot multiple plots per page. +## This plot version automatically advances to the next subplot position +## after each set of arguments are processed. +## +## See the description of the @var{plot} function for the various options. +## @end deftypefn ## Author: Vinayak Dutt ## Adapted-By: jwe diff -r 0748b03c3510 -r a4cd1e9d9962 scripts/plot/multiplot.m --- a/scripts/plot/multiplot.m Sat Nov 20 14:52:42 1999 +0000 +++ b/scripts/plot/multiplot.m Sat Nov 20 17:23:01 1999 +0000 @@ -17,16 +17,15 @@ ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -## usage: multiplot (xn, yn) -## -## Sets and resets multiplot mode -## -## If multiplot(0,0) then it will close multiplot mode and and if -## arguments are non-zero, then it will set up multiplot mode with -## xn,yn subplots along x and y axes. -## -## NOTE: this will work only with gnuplot installed with -## multiplot patch +## -*- texinfo -*- +## @deftypefn {Function File} {} multiplot (@var{xn}, @var{yn}) +## Sets and resets multiplot mode. +## +## If the arguments are non-zero, @code{multiplot} will set up multiplot +## mode with @var{xn}, @var{yn} subplots along the @var{x} and @var{y} +## axes. If both arguments are zero, @code{multiplot} closes multiplot +## mode. +## @end deftypefn ## Author: Vinayak Dutt, Dutt.Vinayak@mayo.EDU ## Created: 3 July 95 diff -r 0748b03c3510 -r a4cd1e9d9962 scripts/plot/oneplot.m --- a/scripts/plot/oneplot.m Sat Nov 20 14:52:42 1999 +0000 +++ b/scripts/plot/oneplot.m Sat Nov 20 17:23:01 1999 +0000 @@ -17,13 +17,10 @@ ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -## usage: oneplot -## -## NOTE: this will work only with gnuplot installed with -## multiplot patch -## -## Switches from multiplot (if in multiplot mode) to single plot -## mode +## -*- texinfo -*- +## @deftypefn {Function File} {} oneplot () +## If in multiplot mode, switches to single plot mode. +## @end deftypefn ## Author: Vinayak Dutt ## Created: 3 July 95 diff -r 0748b03c3510 -r a4cd1e9d9962 scripts/plot/plot.m --- a/scripts/plot/plot.m Sat Nov 20 14:52:42 1999 +0000 +++ b/scripts/plot/plot.m Sat Nov 20 17:23:01 1999 +0000 @@ -17,47 +17,145 @@ ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -## usage: plot (x, y) -## plot (x1, y1, x2, y2, ...) -## plot (x, y, fmt) -## +## -*- texinfo -*- +## @deftypefn {Function File} {} plot (@var{args}) +## This function produces two-dimensional plots. Many different +## combinations of arguments are possible. The simplest form is +## +## @example +## plot (@var{y}) +## @end example +## +## @noindent +## where the argument is taken as the set of @var{y} coordinates and the +## @var{x} coordinates are taken to be the indices of the elements, +## starting with 1. +## +## If more than one argument is given, they are interpreted as +## +## @example +## plot (@var{x}, @var{y}, @var{fmt} ...) +## @end example +## +## @noindent +## where @var{y} and @var{fmt} are optional, and any number of argument +## sets may appear. The @var{x} and @var{y} values are +## interpreted as follows: +## +## @itemize @bullet +## @item +## If a single data argument is supplied, it is taken as the set of @var{y} +## coordinates and the @var{x} coordinates are taken to be the indices of +## the elements, starting with 1. +## +## @item ## If the first argument is a vector and the second is a matrix, the ## the vector is plotted versus the columns (or rows) of the matrix. ## (using whichever combination matches, with columns tried first.) -## +## +## @item ## If the first argument is a matrix and the second is a vector, the ## the columns (or rows) of the matrix are plotted versus the vector. ## (using whichever combination matches, with columns tried first.) -## -## If both arguments are vectors, the elements of y are plotted versus -## the elements of x. -## -## If both arguments are matrices, the columns of y are plotted versus -## the columns of x. In this case, both matrices must have the same -## number of rows and columns and no attempt is made to transpose the -## arguments to make the number of rows match. -## +## +## @item +## If both arguments are vectors, the elements of @var{y} are plotted versus +## the elements of @var{x}. +## +## @item +## If both arguments are matrices, the columns of @var{y} are plotted +## versus the columns of @var{x}. In this case, both matrices must have +## the same number of rows and columns and no attempt is made to transpose +## the arguments to make the number of rows match. +## ## If both arguments are scalars, a single point is plotted. -## -## If only one argument is given, it is taken as the set of y -## coordinates and the x coordinates are taken to be the indices of the -## elements, starting with 1. -## -## To see possible options for FMT please see __pltopt__. -## -## Examples: -## -## plot (x, y, "@12", x, y2, x, y3, "4", x, y4, "+") -## -## y will be plotted with points of type 2 ("+") and color 1 (red). -## y2 will be plotted with lines. -## y3 will be plotted with lines of color 4. -## y4 will be plotted with points which are "+"s. -## -## plot (b, "*") -## -## b will be plotted with points of type "*". -## +## @end itemize +## +## If the @var{fmt} argument is supplied, it is interpreted as +## follows. If @var{fmt} is missing, the default gnuplot line style +## is assumed. +## +## @table @samp +## @item - +## Set lines plot style (default). +## +## @item . +## Set dots plot style. +## +## @item @@ +## Set points plot style. +## +## @item -@@ +## Set linespoints plot style. +## +## @item ^ +## Set impulses plot style. +## +## @item L +## Set steps plot style. +## +## @item # +## Set boxes plot style. +## +## @item ~ +## Set errorbars plot style. +## +## @item #~ +## Set boxerrorbars plot style. +## +## @item @var{n} +## Interpreted as the plot color if @var{n} is an integer in the range 1 to +## 6. +## +## @item @var{nm} +## If @var{nm} is a two digit integer and @var{m} is an integer in the +## range 1 to 6, @var{m} is interpreted as the point style. This is only +## valid in combination with the @code{@@} or @code{-@@} specifiers. +## +## @item @var{c} +## If @var{c} is one of @code{"r"}, @code{"g"}, @code{"b"}, @code{"m"}, +## @code{"c"}, or @code{"w"}, it is interpreted as the plot color (red, +## green, blue, magenta, cyan, or white). +## +## @item + +## @itemx * +## @itemx o +## @itemx x +## Used in combination with the points or linespoints styles, set the point +## style. +## @end table +## +## The color line styles have the following meanings on terminals that +## support color. +## +## @example +## Number Gnuplot colors (lines)points style +## 1 red * +## 2 green + +## 3 blue o +## 4 magenta x +## 5 cyan house +## 6 brown there exists +## @end example +## +## Here are some plot examples: +## +## @example +## plot (x, y, "@@12", x, y2, x, y3, "4", x, y4, "+") +## @end example +## +## This command will plot @code{y} with points of type 2 (displayed as +## @samp{+}) and color 1 (red), @code{y2} with lines, @code{y3} with lines of +## color 4 (magenta) and @code{y4} with points displayed as @samp{+}. +## +## @example +## plot (b, "*") +## @end example +## +## This command will plot the data in the variable @code{b} will be plotted +## with points displayed as @samp{*}. +## @end deftypefn + ## See also: semilogx, semilogy, loglog, polar, mesh, contour, __pltopt__ ## bar, stairs, gplot, gsplot, replot, xlabel, ylabel, title diff -r 0748b03c3510 -r a4cd1e9d9962 scripts/plot/plot_border.m --- a/scripts/plot/plot_border.m Sat Nov 20 14:52:42 1999 +0000 +++ b/scripts/plot/plot_border.m Sat Nov 20 17:23:01 1999 +0000 @@ -17,24 +17,35 @@ ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -## usage: plot_border (...) -## -## NOTE: this will work only with gnuplot installed with -## multiplot patch -## +## -*- texinfo -*- +## @deftypefn {Function File} {} plot_border (...) ## Multiple arguments allowed to specify the sides on which the border -## is shown. allowed strings: -## -## allowed input strings: -## -## "blank", "BLANK", "b", "B", ---> No borders displayed -## "all", "ALL", "a", "A", ---> All borders displayed -## "north", "NORTH", "n", "N", ---> North Border -## "south", "SOUTH", "s", "S", ---> South Border -## "east", "EAST", "e", "E", ---> East Border -## "west", "WEST", "w", "W", ---> West Border -## -## Without any arguments, turns borders off. +## is shown. Allowed arguments include: +## +## @table @code +## @item "blank" +## No borders displayed. +## +## @item "all" +## All borders displayed +## +## @item "north" +## North Border +## +## @item "south" +## South Border +## +## @item "east" +## East Border +## +## @item "west" +## West Border +## @end table +## +## @noindent +## The arguments may be abbreviated to single characters. Without any +## arguments, @code{plot_border} turns borders off. +## @end deftypefn ## Author: Vinayak Dutt ## Created: 3 July 95 diff -r 0748b03c3510 -r a4cd1e9d9962 scripts/plot/polar.m --- a/scripts/plot/polar.m Sat Nov 20 14:52:42 1999 +0000 +++ b/scripts/plot/polar.m Sat Nov 20 17:23:01 1999 +0000 @@ -17,12 +17,14 @@ ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -## usage: polar (theta, rho, fmt) -## -## Make a 2D plot given polar the coordinates theta and rho. +## -*- texinfo -*- +## @deftypefn {Function File} {} polar (@var{theta}, @var{rho}, @var{fmt}) +## Make a two-dimensional plot given polar the coordinates @var{theta} and +## @var{rho}. ## ## The optional third argument specifies the line type. -## +## @end deftypefn + ## See also: plot, semilogx, semilogy, loglog, mesh, contour, bar, ## stairs, gplot, gsplot, replot, xlabel, ylabel, title diff -r 0748b03c3510 -r a4cd1e9d9962 scripts/plot/semilogx.m --- a/scripts/plot/semilogx.m Sat Nov 20 14:52:42 1999 +0000 +++ b/scripts/plot/semilogx.m Sat Nov 20 17:23:01 1999 +0000 @@ -17,15 +17,13 @@ ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -## usage: semilogx (x, y) -## semilogx (x1, y1, x2, y2, ...) -## semilogx (x, y, fmt) -## -## Make a 2D plot of y versus x using a log scale for the x axis. -## -## See the help message for the plot command for a description of how -## the arguments are interpreted. -## +## -*- texinfo -*- +## @deftypefn {Function File} {} semilogx (@var{args}) +## Make a two-dimensional plot using a log scale for the @var{x} axis. See +## the description of @code{plot} for a description of the arguments +## that @code{semilogx} will accept. +## @end deftypefn + ## See also: plot, semilogy, loglog, polar, mesh, contour, bar, stairs, ## gplot, gsplot, replot, xlabel, ylabel, title diff -r 0748b03c3510 -r a4cd1e9d9962 scripts/plot/semilogy.m --- a/scripts/plot/semilogy.m Sat Nov 20 14:52:42 1999 +0000 +++ b/scripts/plot/semilogy.m Sat Nov 20 17:23:01 1999 +0000 @@ -17,15 +17,13 @@ ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -## usage: semilogy (x, y) -## semilogy (x1, y1, x2, y2, ...) -## semilogy (x, y, fmt) -## -## Make a 2D plot of y versus x using a log scale for the x axis. -## -## See the help message for the plot command for a description of how -## the arguments are interpreted. -## +## -*- texinfo -*- +## @deftypefn {Function File} {} semilogy (@var{args}) +## Make a two-dimensional plot using a log scale for the @var{y} axis. See +## the description of @code{plot} for a description of the arguments +## that @code{semilogy} will accept. +## @end deftypefn + ## See also: plot, semilogx, loglog, polar, mesh, contour, bar, stairs, ## gplot, gsplot, replot, xlabel, ylabel, title diff -r 0748b03c3510 -r a4cd1e9d9962 scripts/plot/stairs.m --- a/scripts/plot/stairs.m Sat Nov 20 14:52:42 1999 +0000 +++ b/scripts/plot/stairs.m Sat Nov 20 17:23:01 1999 +0000 @@ -17,25 +17,32 @@ ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -## usage: [xs, ys] = stairs (x, y) -## -## Given two vectors of x-y data, stairs produces a `stairstep' plot. -## +## -*- texinfo -*- +## @deftypefn {Function File} {} stairs (@var{x}, @var{y}) +## Given two vectors of x-y data, bar produces a `stairstep' plot. +## ## If only one argument is given, it is taken as a vector of y-values -## and the x coordiates are taken to be the indices of the elements. -## +## and the x coordinates are taken to be the indices of the elements. +## ## If two output arguments are specified, the data are generated but ## not plotted. For example, -## -## stairs (x, y); -## +## +## @example +## stairs (x, y); +## @end example +## +## @noindent ## and -## -## [xs, ys] = stairs (x, y); -## plot (xs, ys); -## +## +## @example +## [xs, ys] = stairs (x, y); +## plot (xs, ys); +## @end example +## +## @noindent ## are equivalent. -## +## @end deftypefn + ## See also: plot, semilogx, semilogy, loglog, polar, mesh, contour, ## bar, gplot, gsplot, replot, xlabel, ylabel, title diff -r 0748b03c3510 -r a4cd1e9d9962 scripts/plot/subplot.m --- a/scripts/plot/subplot.m Sat Nov 20 14:52:42 1999 +0000 +++ b/scripts/plot/subplot.m Sat Nov 20 17:23:01 1999 +0000 @@ -17,41 +17,57 @@ ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -## usage: subplot (rows, columns, index) -## subplot (rcn) -## -## NOTE: this will work only with gnuplot installed with -## multiplot patch (or version 3.6 beta) -## -## Sets gnuplot in multiplot mode and plots in location -## given by index (there are columns X rows subwindows) -## +## -*- texinfo -*- +## @deftypefn {Function File} {} subplot (@var{rows}, @var{cols}, @var{index}) +## @deftypefnx {Function File} {} subplot (@var{rcn}) +## Sets @code{gnuplot} in multiplot mode and plots in location +## given by index (there are @var{cols} by @var{rows} subwindows). +## ## Input: -## -## rows : number of rows in subplot grid -## columns: number of columns in subplot grid -## index : index of subplot where to make the next plot -## -## If only one arg, then it (crn) has to be three digit value -## specifying the location in digit 1 (rows) and 2 (columns) and digit -## 3 is the plot index -## -## The plot index runs row-wise,i.e., first all the columns in a row -## are filled and then the next row is filled -## -## For example, plot with 4 X 2 grid, will have plot indices running as +## +## @table @var +## @item rows +## Number of rows in subplot grid. +## +## @item columns +## Number of columns in subplot grid. +## +## @item index +## Index of subplot where to make the next plot. +## @end table +## +## If only one argument is supplied, then it must be a three digit value +## specifying the location in digits 1 (rows) and 2 (columns) and the plot +## index in digit 3. +## +## The plot index runs row-wise. First all the columns in a row are filled +## and then the next row is filled. +## +## For example, a plot with 4 by 2 grid will have plot indices running as ## follows: -## -## ----------------------------------- -## | | | | | -## | 1 | 2 | 3 | 4 | -## | | | | | -## ----------------------------------- -## | | | | | -## | 5 | 6 | 7 | 8 | -## | | | | | -## ----------------------------------- -## +## @iftex +## @tex +## \vskip 10pt +## \hfil\vbox{\offinterlineskip\hrule +## \halign{\vrule#&&\qquad\hfil#\hfil\qquad\vrule\cr +## height13pt&1&2&3&4\cr height12pt&&&&\cr\noalign{\hrule} +## height13pt&5&6&7&8\cr height12pt&&&&\cr\noalign{\hrule}}} +## \hfil +## \vskip 10pt +## @end tex +## @end iftex +## @ifinfo +## @display +## @group +## +-----+-----+-----+-----+ +## | 1 | 2 | 3 | 4 | +## +-----+-----+-----+-----+ +## | 5 | 6 | 7 | 8 | +## +-----+-----+-----+-----+ +## @end group +## @end display +## @end ifinfo +## @end deftypefn ## Author: Vinayak Dutt ## Adapted-By: jwe diff -r 0748b03c3510 -r a4cd1e9d9962 scripts/plot/subwindow.m --- a/scripts/plot/subwindow.m Sat Nov 20 14:52:42 1999 +0000 +++ b/scripts/plot/subwindow.m Sat Nov 20 17:23:01 1999 +0000 @@ -17,14 +17,13 @@ ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -## usage: subwindow (xn, yn) -## -## NOTE: this will work only with gnuplot installed with -## multiplot patch -## -## Sets subwindow position in multiplot mode for next plot. The -## multiplot mode has to be previously initialized using multiplot() -## command, else this command just becomes an aliad to multiplot() +## -*- texinfo -*- +## @deftypefn {Function File} {} subwindow (@var{xn}, @var{yn}) +## Sets the subwindow position in multiplot mode for the next plot. The +## multiplot mode has to be previously initialized using the +## @code{multiplot} function, otherwise this command just becomes an alias +## to @code{multiplot} +## @end deftypefn ## Author: Vinayak Dutt ## Created: 3 July 95 diff -r 0748b03c3510 -r a4cd1e9d9962 scripts/plot/title.m --- a/scripts/plot/title.m Sat Nov 20 14:52:42 1999 +0000 +++ b/scripts/plot/title.m Sat Nov 20 17:23:01 1999 +0000 @@ -17,11 +17,12 @@ ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -## usage: title (text) -## -## Defines a title for a plot. The title will appear the next time a -## plot is displayed. -## +## -*- texinfo -*- +## @deftypefn {Function File} {} title (@var{string}) +## Specify a title for a plot. If you already have a plot displayed, use +## the command @code{replot} to redisplay it with the new title. +## @end deftypefn + ## See also: plot, semilogx, semilogy, loglog, polar, mesh, contour, ## bar, stairs, gplot, gsplot, replot, xlabel, ylabel diff -r 0748b03c3510 -r a4cd1e9d9962 scripts/plot/top_title.m --- a/scripts/plot/top_title.m Sat Nov 20 14:52:42 1999 +0000 +++ b/scripts/plot/top_title.m Sat Nov 20 17:23:01 1999 +0000 @@ -17,12 +17,11 @@ ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -## usage: top_title (text) -## -## NOTE: this will work only with gnuplot installed with -## multiplot patch -## -## makes a title with text "text" at the top of the plot +## -*- texinfo -*- +## @deftypefn {Function File} {} top_title (@var{string}) +## @deftypefnx {Function File} {} bottom_title (@var{string}) +## Makes a title with text @var{string} at the top (bottom) of the plot. +## @end deftypefn ## Author: Vinayak Dutt ## Created: 3 July 95 diff -r 0748b03c3510 -r a4cd1e9d9962 scripts/plot/xlabel.m --- a/scripts/plot/xlabel.m Sat Nov 20 14:52:42 1999 +0000 +++ b/scripts/plot/xlabel.m Sat Nov 20 17:23:01 1999 +0000 @@ -17,11 +17,15 @@ ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -## usage: xlabel (text) -## -## Defines a label for the x-axis of a plot. The label will appear the -## next time a plot is displayed. -## +## -*- texinfo -*- +## @deftypefn {Function File} {} xlabel (@var{string}) +## @deftypefnx {Function File} {} ylabel (@var{string}) +## @deftypefnx {Function File} {} zlabel (@var{string}) +## Specify x, y, and z axis labels for the plot. If you already have a plot +## displayed, use the command @code{replot} to redisplay it with the new +## labels. +## @end deftypefn + ## See also: plot, semilogx, semilogy, loglog, polar, mesh, contour, ## bar, stairs, gplot, gsplot, replot, ylabel, title diff -r 0748b03c3510 -r a4cd1e9d9962 scripts/plot/ylabel.m --- a/scripts/plot/ylabel.m Sat Nov 20 14:52:42 1999 +0000 +++ b/scripts/plot/ylabel.m Sat Nov 20 17:23:01 1999 +0000 @@ -17,11 +17,8 @@ ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -## usage: ylabel (text) -## -## Defines a label for the y-axis of a plot. The label will appear the -## next time a plot is displayed. -## +## See xlabel. + ## See also: plot, semilogx, semilogy, loglog, polar, mesh, contour, ## bar, stairs, gplot, gsplot, replot, xlabel, title diff -r 0748b03c3510 -r a4cd1e9d9962 scripts/plot/zlabel.m --- a/scripts/plot/zlabel.m Sat Nov 20 14:52:42 1999 +0000 +++ b/scripts/plot/zlabel.m Sat Nov 20 17:23:01 1999 +0000 @@ -17,12 +17,10 @@ ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -## usage: zlabel (text) -## -## Defines a label for the z-axis of a plot. The label will appear the -## next time a plot is displayed. -## -## See other plotting commands also. +## See xlabel. + +## See also: plot, semilogx, semilogy, loglog, polar, mesh, contour, +## bar, stairs, gplot, gsplot, replot, xlabel, title ## Author: Vinayak Dutt ## Created: 3 July 95 diff -r 0748b03c3510 -r a4cd1e9d9962 scripts/polynomial/compan.m --- a/scripts/polynomial/compan.m Sat Nov 20 14:52:42 1999 +0000 +++ b/scripts/polynomial/compan.m Sat Nov 20 17:23:01 1999 +0000 @@ -17,29 +17,42 @@ ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -## usage: compan (c) -## -## Compute the companion matrix corresponding to polynomial vector c. -## -## In octave a polynomial is represented by it's coefficients (arranged -## in descending order). For example a vector c of length n+1 corresponds -## to the following nth order polynomial -## -## p(x) = c(1) x^n + ... + c(n) x + c(n+1). -## -## The corresponding companion matrix is -## _ _ -## | -c(2)/c(1) -c(3)/c(1) ... -c(n)/c(1) -c(n+1)/c(1) | -## | 1 0 ... 0 0 | -## | 0 1 ... 0 0 | -## A = | . . . . . | -## | . . . . . | -## | . . . . . | -## |_ 0 0 ... 1 0 _| -## +## -*- texinfo -*- +## @deftypefn {Function File} {} compan (@var{c}) +## Compute the companion matrix corresponding to polynomial coefficient +## vector @var{c}. +## +## The companion matrix is +## @iftex +## @tex +## $$ +## A = \left[\matrix{ +## -c_2/c_1 & -c_3/c_1 & \cdots & -c_N/c_1 & -c_{N+1}/c_1\cr +## 1 & 0 & \cdots & 0 & 0 \cr +## 0 & 1 & \cdots & 0 & 0 \cr +## \vdots & \vdots & \ddots & \vdots & \vdots \cr +## 0 & 0 & \cdots & 1 & 0}\right]. +## $$ +## @end tex +## @end iftex +## @ifinfo +## +## @smallexample +## _ _ +## | -c(2)/c(1) -c(3)/c(1) ... -c(N)/c(1) -c(N+1)/c(1) | +## | 1 0 ... 0 0 | +## | 0 1 ... 0 0 | +## A = | . . . . . | +## | . . . . . | +## | . . . . . | +## |_ 0 0 ... 1 0 _| +## @end smallexample +## @end ifinfo +## ## The eigenvalues of the companion matrix are equal to the roots of the ## polynomial. -## +## @end deftypefn + ## SEE ALSO: poly, roots, residue, conv, deconv, polyval, polyderiv, polyinteg ## Author: Tony Richardson diff -r 0748b03c3510 -r a4cd1e9d9962 scripts/polynomial/conv.m --- a/scripts/polynomial/conv.m Sat Nov 20 14:52:42 1999 +0000 +++ b/scripts/polynomial/conv.m Sat Nov 20 17:23:01 1999 +0000 @@ -17,16 +17,16 @@ ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -## usage: conv (a, b) -## +## -*- texinfo -*- +## @deftypefn {Function File} {} conv (@var{a}, @var{b}) ## Convolve two vectors. -## -## y = conv (a, b) returns a vector of length equal to length (a) + -## length (b) -1. -## -## If a and b are polynomial coefficient vectors, conv returns the -## coefficients of the product polynomial. -## +## +## @code{y = conv (a, b)} returns a vector of length equal to +## @code{length (a) + length (b) - 1}. +## If @var{a} and @var{b} are polynomial coefficient vectors, @code{conv} +## returns the coefficients of the product polynomial. +## @end deftypefn + ## SEE ALSO: deconv, poly, roots, residue, polyval, polyderiv, polyinteg ## Author: Tony Richardson diff -r 0748b03c3510 -r a4cd1e9d9962 scripts/polynomial/deconv.m --- a/scripts/polynomial/deconv.m Sat Nov 20 14:52:42 1999 +0000 +++ b/scripts/polynomial/deconv.m Sat Nov 20 17:23:01 1999 +0000 @@ -17,19 +17,19 @@ ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -## usage: deconv (y, a) -## +## -*- texinfo -*- +## @deftypefn {Function File} {} deconv (@var{y}, @var{a}) ## Deconvolve two vectors. -## -## [b, r] = deconv (y, a) solves for b and r such that -## y = conv(a,b) + r -## -## If y and a are polynomial coefficient vectors, b will contain the -## coefficients of the polynomial quotient and r will be a remander -## polynomial of lowest order. -## -## SEE ALSO: conv, poly, roots, residue, polyval, polyderiv, -## polyinteg +## +## @code{[b, r] = deconv (y, a)} solves for @var{b} and @var{r} such that +## @code{y = conv (a, b) + r}. +## +## If @var{y} and @var{a} are polynomial coefficient vectors, @var{b} will +## contain the coefficients of the polynomial quotient and @var{r} will be +## a remander polynomial of lowest order. +## @end deftypefn + +## SEE ALSO: conv, poly, roots, residue, polyval, polyderiv, polyinteg ## Author: Tony Richardson ## Created: June 1994 diff -r 0748b03c3510 -r a4cd1e9d9962 scripts/polynomial/poly.m --- a/scripts/polynomial/poly.m Sat Nov 20 14:52:42 1999 +0000 +++ b/scripts/polynomial/poly.m Sat Nov 20 17:23:01 1999 +0000 @@ -17,14 +17,14 @@ ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -## usage: poly (x) -## -## If A is a square n-by-n matrix, poly (A) is the row vector of -## the coefficients of det (z * eye(n) - A), the characteristic -## polynomial of A. -## -## If x is a vector, poly (x) is a vector of coefficients of the -## polynomial whose roots are the elements of x. +## -*- texinfo -*- +## @deftypefn {Function File} {} poly (@var{a}) +## If @var{a} is a square @var{N}-by-@var{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}. 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}. +## @end deftypefn ## Author: KH ## Created: 24 December 1993 diff -r 0748b03c3510 -r a4cd1e9d9962 scripts/polynomial/polyderiv.m --- a/scripts/polynomial/polyderiv.m Sat Nov 20 14:52:42 1999 +0000 +++ b/scripts/polynomial/polyderiv.m Sat Nov 20 17:23:01 1999 +0000 @@ -17,11 +17,12 @@ ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -## usage: polyderiv (p) -## -## Returns the coefficients of the derivative of the polynomial whose -## coefficients are given by vector p. -## +## -*- texinfo -*- +## @deftypefn {Function File} {} polyderiv (@var{c}) +## Return the coefficients of the derivative of the polynomial whose +## coefficients are given by vector @var{c}. +## @end deftypefn + ## SEE ALSO: poly, polyinteg, polyreduce, roots, conv, deconv, residue, ## filter, polyval, polyvalm diff -r 0748b03c3510 -r a4cd1e9d9962 scripts/polynomial/polyfit.m --- a/scripts/polynomial/polyfit.m Sat Nov 20 14:52:42 1999 +0000 +++ b/scripts/polynomial/polyfit.m Sat Nov 20 17:23:01 1999 +0000 @@ -17,14 +17,25 @@ ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -## usage: [p, yf] = polyfit (x, y, n) -## -## Returns the coefficients of a polynomial p(x) of degree n that -## minimizes sumsq (p(x(i)) - y(i)), i.e., that best fits the data -## in the least squares sense. -## -## If two outputs are requested, also return the values of the -## polynomial for each value of x. +## -*- texinfo -*- +## @deftypefn {Function File} {[@var{p}, @var{yf}] =} polyfit (@var{x}, @var{y}, @var{n}) +## Return the coefficients of a polynomial @var{p}(@var{x}) of degree +## @var{n} that minimizes +## @iftex +## @tex +## $$ +## \sum_{i=1}^N (p(x_i) - y_i)^2 +## $$ +## @end tex +## @end iftex +## @ifinfo +## @code{sumsq (p(x(i)) - y(i))}, +## @end ifinfo +## to best fit the data in the least squares sense. +## +## If two output arguments are requested, the second contains the values of +## the polynomial for each value of @var{x}. +## @end deftypefn ## Author: KH ## Created: 13 December 1994 diff -r 0748b03c3510 -r a4cd1e9d9962 scripts/polynomial/polyinteg.m --- a/scripts/polynomial/polyinteg.m Sat Nov 20 14:52:42 1999 +0000 +++ b/scripts/polynomial/polyinteg.m Sat Nov 20 17:23:01 1999 +0000 @@ -17,13 +17,14 @@ ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -## usage: polyinteg (p) -## -## Returns the coefficients of the integral the polynomial whose coefficients -## are represented by the vector p. -## -## The constant of integration is zero. -## +## -*- texinfo -*- +## @deftypefn {Function File} {} polyinteg (@var{c}) +## Return the coefficients of the integral of the polynomial whose +## coefficients are represented by the vector @var{c}. +## +## The constant of integration is set to zero. +## @end deftypefn + ## SEE ALSO: poly, polyderiv, polyreduce, roots, conv, deconv, residue, ## filter, polyval, polyvalm diff -r 0748b03c3510 -r a4cd1e9d9962 scripts/polynomial/polyreduce.m --- a/scripts/polynomial/polyreduce.m Sat Nov 20 14:52:42 1999 +0000 +++ b/scripts/polynomial/polyreduce.m Sat Nov 20 17:23:01 1999 +0000 @@ -17,11 +17,12 @@ ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -## usage: polyreduce(c) -## -## Reduces a polynomial coefficient vector to a minimum number of terms, -## i.e. it strips off any leading zeros. -## +## -*- texinfo -*- +## @deftypefn {Function File} {} polyreduce (@var{c}) +## Reduces a polynomial coefficient vector to a minimum number of terms by +## stripping off any leading zeros. +## @end deftypefn + ## SEE ALSO: poly, roots, conv, deconv, residue, filter, polyval, polyvalm, ## polyderiv, polyinteg diff -r 0748b03c3510 -r a4cd1e9d9962 scripts/polynomial/polyval.m --- a/scripts/polynomial/polyval.m Sat Nov 20 14:52:42 1999 +0000 +++ b/scripts/polynomial/polyval.m Sat Nov 20 17:23:01 1999 +0000 @@ -17,21 +17,17 @@ ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -## usage: polyval (c, x) -## +## -*- texinfo -*- +## @deftypefn {Function File} {} polyval (@var{c}, @var{x}) ## Evaluate a polynomial. -## -## In octave, a polynomial is represented by it's coefficients (arranged -## in descending order). For example a vector c of length n+1 corresponds -## to the following nth order polynomial -## -## p(x) = c(1) x^n + ... + c(n) x + c(n+1). -## -## polyval(c,x) will evaluate the polynomial at the specified value of x. -## -## If x is a vector or matrix, the polynomial is evaluated at each of the -## elements of x. -## +## +## @code{polyval (@var{c}, @var{x})} will evaluate the polynomial at the +## specified value of @var{x}. +## +## If @var{x} is a vector or matrix, the polynomial is evaluated at each of +## the elements of @var{x}. +## @end deftypefn + ## SEE ALSO: polyvalm, poly, roots, conv, deconv, residue, filter, ## polyderiv, polyinteg diff -r 0748b03c3510 -r a4cd1e9d9962 scripts/polynomial/polyvalm.m --- a/scripts/polynomial/polyvalm.m Sat Nov 20 14:52:42 1999 +0000 +++ b/scripts/polynomial/polyvalm.m Sat Nov 20 17:23:01 1999 +0000 @@ -17,22 +17,17 @@ ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -## usage: polyvalm (c, x) -## +## -*- texinfo -*- +## @deftypefn {Function File} {} polyvalm (@var{c}, @var{x}) ## Evaluate a polynomial in the matrix sense. -## -## In octave, a polynomial is represented by it's coefficients (arranged -## in descending order). For example a vector c of length n+1 corresponds -## to the following nth order polynomial -## -## p(x) = c(1) x^n + ... + c(n) x + c(n+1). -## -## polyvalm(c,X) will evaluate the polynomial in the matrix sense, i.e. matrix -## multiplication is used instead of element by element multiplication as is -## used in polyval. -## -## X must be a square matrix. -## +## +## @code{polyvalm (@var{c}, @var{x})} will evaluate the polynomial in the +## matrix sense, i.e. matrix multiplication is used instead of element by +## element multiplication as is used in polyval. +## +## The argument @var{x} must be a square matrix. +## @end deftypefn + ## SEE ALSO: polyval, poly, roots, conv, deconv, residue, filter, ## polyderiv, polyinteg diff -r 0748b03c3510 -r a4cd1e9d9962 scripts/polynomial/residue.m --- a/scripts/polynomial/residue.m Sat Nov 20 14:52:42 1999 +0000 +++ b/scripts/polynomial/residue.m Sat Nov 20 17:23:01 1999 +0000 @@ -17,49 +17,90 @@ ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -## usage: [r, p, k, e] = residue (b, a) -## -## If b and a are vectors of polynomial coefficients, then residue -## calculates the partial fraction expansion corresponding to the -## ratio of the two polynomials. The vector r contains the residue -## terms, p contains the pole values, k contains the coefficients of -## a direct polynomial term (if it exists) and e is a vector containing -## the powers of the denominators in the partial fraction terms. -## Assuming b and a represent polynomials P(s) and Q(s) we have: -## +## -*- texinfo -*- +## @deftypefn {Function File} {} residue (@var{b}, @var{a}, @var{tol}) +## If @var{b} and @var{a} are vectors of polynomial coefficients, then +## residue calculates the partial fraction expansion corresponding to the +## ratio of the two polynomials. +## @cindex partial fraction expansion +## +## The function @code{residue} returns @var{r}, @var{p}, @var{k}, and +## @var{e}, where the vector @var{r} contains the residue terms, @var{p} +## contains the pole values, @var{k} contains the coefficients of a direct +## polynomial term (if it exists) and @var{e} is a vector containing the +## powers of the denominators in the partial fraction terms. +## +## Assuming @var{b} and @var{a} represent polynomials +## @iftex +## @tex +## $P(s)$ and $Q(s)$ +## @end tex +## @end iftex +## @ifinfo +## P (s) and Q(s) +## @end ifinfo +## we have: +## @iftex +## @tex +## $$ +## {P(s)\over Q(s)} = \sum_{m=1}^M {r_m\over (s-p_m)^e_m} +## + \sum_{i=1}^N k_i s^{N-i}. +## $$ +## @end tex +## @end iftex +## @ifinfo +## +## @example ## P(s) M r(m) N -## ---- = # ------------- + # k(n)*s^(N-n) -## Q(s) m=1 (s-p(m))^e(m) n=1 -## -## (# represents summation) where M is the number of poles (the length of -## the r, p, and e vectors) and N is the length of the k vector. -## -## [r p k e] = residue(b,a,tol) -## -## This form of the function call may be used to set a tolerance value. -## The default value is 0.001. The tolerance value is used to determine -## whether poles with small imaginary components are declared real. It is -## also used to determine if two poles are distinct. If the ratio of the -## imaginary part of a pole to the real part is less than tol, the -## imaginary part is discarded. If two poles are farther apart than tol -## they are distinct. -## -## Example: -## b = [1, 1, 1]; +## ---- = SUM ------------- + SUM k(i)*s^(N-i) +## Q(s) m=1 (s-p(m))^e(m) i=1 +## @end example +## @end ifinfo +## +## @noindent +## where @var{M} is the number of poles (the length of the @var{r}, +## @var{p}, and @var{e} vectors) and @var{N} is the length of the @var{k} +## vector. +## +## The argument @var{tol} is optional, and if not specified, a default +## value of 0.001 is assumed. The tolerance value is used to determine +## whether poles with small imaginary components are declared real. It is +## also used to determine if two poles are distinct. If the ratio of the +## imaginary part of a pole to the real part is less than @var{tol}, the +## imaginary part is discarded. If two poles are farther apart than +## @var{tol} they are distinct. For example, +## +## @example +## @group +## b = [1, 1, 1]; ## a = [1, -5, 8, -4]; -## -## [r, p, k, e] = residue (b, a) -## -## returns -## -## r = [-2, 7, 3]; p = [2, 2, 1]; k = []; e = [1, 2, 1]; -## -## which implies the following partial fraction expansion -## -## s^2 + s + 1 -2 7 3 +## [r, p, k, e] = residue (b, a); +## @result{} r = [-2, 7, 3] +## @result{} p = [2, 2, 1] +## @result{} k = [](0x0) +## @result{} e = [1, 2, 1] +## @end group +## @end example +## +## @noindent +## which implies the following partial fraction expansion +## @iftex +## @tex +## $$ +## {s^2+s+1\over s^3-5s^2+8s-4} = {-2\over s-2} + {7\over (s-2)^2} + {3\over s-1} +## $$ +## @end tex +## @end iftex +## @ifinfo +## +## @example +## s^2 + s + 1 -2 7 3 ## ------------------- = ----- + ------- + ----- ## s^3 - 5s^2 + 8s - 4 (s-2) (s-2)^2 (s-1) -## +## @end example +## @end ifinfo +## @end deftypefn + ## SEE ALSO: poly, roots, conv, deconv, polyval, polyderiv, polyinteg ## Author: Tony Richardson diff -r 0748b03c3510 -r a4cd1e9d9962 scripts/polynomial/roots.m --- a/scripts/polynomial/roots.m Sat Nov 20 14:52:42 1999 +0000 +++ b/scripts/polynomial/roots.m Sat Nov 20 17:23:01 1999 +0000 @@ -17,10 +17,25 @@ ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -## usage: roots (v) -## -## For a vector v with n components, return the roots of the -## polynomial v(1) * z^(n-1) + ... + v(n-1) * z + v(n). +## -*- texinfo -*- +## @deftypefn {Function File} {} roots (@var{v}) +## +## For a vector @var{v} with @var{N} components, return +## the roots of the polynomial +## @iftex +## @tex +## $$ +## v_1 z^{N-1} + \cdots + v_{N-1} z + v_N. +## $$ +## @end tex +## @end iftex +## @ifinfo +## +## @example +## v(1) * z^(N-1) + ... + v(N-1) * z + v(N). +## @end example +## @end ifinfo +## @end deftypefn ## Author: KH ## Created: 24 December 1993 diff -r 0748b03c3510 -r a4cd1e9d9962 scripts/set/complement.m --- a/scripts/set/complement.m Sat Nov 20 14:52:42 1999 +0000 +++ b/scripts/set/complement.m Sat Nov 20 17:23:01 1999 +0000 @@ -17,11 +17,20 @@ ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -## usage: complement (a, b) -## -## Returns the elements of set b that are not in set a. -## -## See - create_set, union, intersection +## -*- texinfo -*- +## @deftypefn {Function File} {} complement (@var{x}, @var{y}) +## Return the elements of set @var{y} that are not in set @var{x}. For +## example, +## +## @example +## @group +## complement ([ 1, 2, 3 ], [ 2, 3, 5 ]) +## @result{} 5 +## @end group +## @end example +## @end deftypefn + +## See also: create_set, union, intersection ## Author: jwe diff -r 0748b03c3510 -r a4cd1e9d9962 scripts/set/create_set.m --- a/scripts/set/create_set.m Sat Nov 20 14:52:42 1999 +0000 +++ b/scripts/set/create_set.m Sat Nov 20 17:23:01 1999 +0000 @@ -17,11 +17,20 @@ ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -## usage: create_set(x) -## -## Returns the unique elements of x, sorted in ascending order. -## -## See - union, intersection, complement +## -*- texinfo -*- +## @deftypefn {Function File} {} create_set (@var{x}) +## Return a row vector containing the unique values in @var{x}, sorted in +## ascending order. For example, +## +## @example +## @group +## create_set ([ 1, 2; 3, 4; 4, 2 ]) +## @result{} [ 1, 2, 3, 4 ] +## @end group +## @end example +## @end deftypefn + +## See also: union, intersection, complement ## Author: jwe diff -r 0748b03c3510 -r a4cd1e9d9962 scripts/set/intersection.m --- a/scripts/set/intersection.m Sat Nov 20 14:52:42 1999 +0000 +++ b/scripts/set/intersection.m Sat Nov 20 17:23:01 1999 +0000 @@ -17,11 +17,20 @@ ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -## usage: intersection(a,b) -## -## Returns the intersection of sets a and b. -## -## See - create_set, union, complement +## -*- texinfo -*- +## @deftypefn {Function File} {} intersection (@var{x}, @var{y}) +## Return the set of elements that are in both sets @var{x} and @var{y}. +## For example, +## +## @example +## @group +## intersection ([ 1, 2, 3 ], [ 2, 3, 5 ]) +## @result{} [ 2, 3 ] +## @end group +## @end example +## @end deftypefn + +## See also: create_set, union, complement ## Author: jwe diff -r 0748b03c3510 -r a4cd1e9d9962 scripts/set/union.m --- a/scripts/set/union.m Sat Nov 20 14:52:42 1999 +0000 +++ b/scripts/set/union.m Sat Nov 20 17:23:01 1999 +0000 @@ -17,11 +17,20 @@ ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -## usage: union(a,b) -## -## Returns the union of sets a and b. -## -## See - create_set, intersection, complement +## -*- texinfo -*- +## @deftypefn {Function File} {} union (@var{x}, @var{y}) +## Return the set of elements that are in either of the sets @var{x} and +## @var{y}. For example, +## +## @example +## @group +## union ([ 1, 2, 4 ], [ 2, 3, 5 ]) +## @result{} [ 1, 2, 3, 4, 5 ] +## @end group +## @end example +## @end deftypefn + +## See also: create_set, intersection, complement ## Author: jwe diff -r 0748b03c3510 -r a4cd1e9d9962 scripts/statistics/base/gls.m --- a/scripts/statistics/base/gls.m Sat Nov 20 14:52:42 1999 +0000 +++ b/scripts/statistics/base/gls.m Sat Nov 20 17:23:01 1999 +0000 @@ -17,21 +17,51 @@ ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -## usage: [BETA, v [,R]] = gls (Y, X, O) -## -## Generalized Least Squares (GLS) estimation for the multivariate model -## -## Y = X*B + E, mean(E) = 0, cov(vec(E)) = (s^2)*O -## -## with Y ... T x p As usual, each row of Y and X is an observation -## X ... T x k and each column a variable. -## B ... k x p -## E ... T x p -## O ... Tp x Tp. -## -## BETA is the GLS estimator for B. -## v is the GLS estimator for s^2. -## R = Y - X*BETA is the matrix of GLS residuals. +## @deftypefn {Function File} {[@var{beta}, @var{v}, @var{r}] =} gls (@var{y}, @var{x}, @var{o}) +## Generalized least squares estimation for the multivariate model +## @iftex +## @tex +## $y = x b + e$ +## with $\bar{e} = 0$ and cov(vec($e$)) = $(s^2)o$, +## @end tex +## @end iftex +## @ifinfo +## @code{@var{y} = @var{x} * @var{b} + @var{e}} with @code{mean (@var{e}) = +## 0} and @code{cov (vec (@var{e})) = (@var{s}^2)*@var{o}}, +## @end ifinfo +## where +## @iftex +## @tex +## $y$ is a $t \times p$ matrix, $x$ is a $t \times k$ matrix, $b$ is a $k +## \times p$ matrix, $e$ is a $t \times p$ matrix, and $o$ is a $tp \times +## tp$ matrix. +## @end tex +## @end iftex +## @ifinfo +## @var{Y} is a @var{T} by @var{p} matrix, @var{X} is a @var{T} by @var{k} +## matrix, @var{B} is a @var{k} by @var{p} matrix, @var{E} is a @var{T} by +## @var{p} matrix, and @var{O} is a @var{T}@var{p} by @var{T}@var{p} +## matrix. +## @end ifinfo +## +## @noindent +## Each row of Y and X is an observation and each column a variable. +## +## The return values @var{beta}, @var{v}, and @var{r} are defined as +## follows. +## +## @table @var +## @item beta +## The GLS estimator for @var{b}. +## +## @item v +## The GLS estimator for @code{@var{s}^2}. +## +## @item r +## The matrix of GLS residuals, @code{@var{r} = @var{y} - @var{x} * +## @var{beta}}. +## @end table +## @end deftypefn ## Author: Teresa Twaroch ## Created: May 1993 diff -r 0748b03c3510 -r a4cd1e9d9962 scripts/statistics/base/ols.m --- a/scripts/statistics/base/ols.m Sat Nov 20 14:52:42 1999 +0000 +++ b/scripts/statistics/base/ols.m Sat Nov 20 17:23:01 1999 +0000 @@ -17,27 +17,62 @@ ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -## usage: [BETA, SIGMA [, R]] = ols (Y, X) -## -## Ordinary Least Squares (OLS) estimation for the multivariate model -## -## Y = X*B + E, mean(E) = 0, cov(vec(E)) = kron(S,I) -## -## with Y ... T x p As usual, each row of Y and X is an observation -## X ... T x k and each column a variable. -## B ... k x p -## E ... T x p. -## -## BETA is the OLS estimator for B, i.e. -## -## BETA = pinv(X)*Y, -## -## where pinv(X) denotes the pseudoinverse of X. -## SIGMA is the OLS estimator for the matrix S, i.e. -## -## SIGMA = (Y - X*BETA)'*(Y - X*BETA) / (T - rank(X)). -## -## R = Y - X*BETA is the matrix of OLS residuals. +## -*- texinfo -*- +## @deftypefn {Function File} {[@var{beta}, @var{sigma}, @var{r}] =} ols (@var{y}, @var{x}) +## Ordinary least squares estimation for the multivariate model +## @iftex +## @tex +## $y = x b + e$ +## with +## $\bar{e} = 0$, and cov(vec($e$)) = kron ($s, I$) +## @end tex +## @end iftex +## @ifinfo +## @code{@var{y} = @var{x}*@var{b} + @var{e}} with +## @code{mean (@var{e}) = 0} and @code{cov (vec (@var{e})) = kron (@var{s}, +## @var{I})}. +## @end ifinfo +## where +## @iftex +## @tex +## $y$ is a $t \times p$ matrix, $x$ is a $t \times k$ matrix, +## $b$ is a $k \times p$ matrix, and $e$ is a $t \times p$ matrix. +## @end tex +## @end iftex +## @ifinfo +## @var{y} is a @var{t} by @var{p} matrix, @var{X} is a @var{t} by @var{k} +## matrix, @var{B} is a @var{k} by @var{p} matrix, and @var{e} is a @var{t} +## by @var{p} matrix. +## @end ifinfo +## +## Each row of @var{y} and @var{x} is an observation and each column a +## variable. +## +## The return values @var{beta}, @var{sigma}, and @var{r} are defined as +## follows. +## +## @table @var +## @item beta +## The OLS estimator for @var{b}, @code{@var{beta} = pinv (@var{x}) * +## @var{y}}, where @code{pinv (@var{x})} denotes the pseudoinverse of +## @var{x}. +## +## @item sigma +## The OLS estimator for the matrix @var{s}, +## +## @example +## @group +## @var{sigma} = (@var{y}-@var{x}*@var{beta})' +## * (@var{y}-@var{x}*@var{beta}) +## / (@var{t}-rank(@var{x})) +## @end group +## @end example +## +## @item r +## The matrix of OLS residuals, @code{@var{r} = @var{y} - @var{x} * +## @var{beta}}. +## @end table +## @end deftypefn ## Author: Teresa Twaroch ## Created: May 1993 diff -r 0748b03c3510 -r a4cd1e9d9962 src/ChangeLog --- a/src/ChangeLog Sat Nov 20 14:52:42 1999 +0000 +++ b/src/ChangeLog Sat Nov 20 17:23:01 1999 +0000 @@ -1,10 +1,17 @@ 1999-11-20 John W. Eaton - * DLD-FUNCTIONS/fft.cc: Texinfoize doc string. - * DLD-FUNCTIONS/ifft.cc: Ditto. - * DLD-FUNCTIONS/fft2.cc: Ditto. - * DLD-FUNCTIONS/ifft2.cc: Ditto. - * DLD-FUNCTIONS/filter.cc: Ditto. + * DLD-FUNCTIONS/fft.cc (Ffft): Texinfoize doc string. + * DLD-FUNCTIONS/ifft.cc (Fifft): Ditto. + * DLD-FUNCTIONS/fft2.cc (Ffft2): Ditto. + * DLD-FUNCTIONS/ifft2.cc (Fifft2): Ditto. + * DLD-FUNCTIONS/filter.cc (Ffilter): Ditto. + * DLD-FUNCTIONS/quad.cc (Fquad, Fquad_options): Ditto. + * DLD-FUNCTIONS/colloc.cc (Fcolloc): Ditto. + * DLD-FUNCTIONS/fsolve.cc (Ffsolve, Ffsolve_options): Ditto. + * defaults.cc (Veditor): Ditto. + * pt-plot.cc (Vautomatic_replot, Vgnuplot_binary, + Vgnuplot_has_frames, Vgnuplot_has_multiplot, Fclearplot, + Fcloseplot, Fpurge_tmp_files, Fishold, Fhold): * Makefile.in (parse.cc): Expect 11 shift/reduce conflicts now. diff -r 0748b03c3510 -r a4cd1e9d9962 src/DLD-FUNCTIONS/colloc.cc --- a/src/DLD-FUNCTIONS/colloc.cc Sat Nov 20 14:52:42 1999 +0000 +++ b/src/DLD-FUNCTIONS/colloc.cc Sat Nov 20 17:23:01 1999 +0000 @@ -35,7 +35,13 @@ #include "utils.h" DEFUN_DLD (colloc, args, , - "[R, A, B, Q] = colloc (N [, \"left\"] [, \"right\"]): collocation weights") + "-*- texinfo -*-\n\ +@deftypefn {Loadable Function} {[@var{r}, @var{A}, @var{B}, @var{q}] =} colloc (@var{n}, \"left\", \"right\")\n\ +Compute derivative and integral weight matrices for orthogonal\n\ +collocation using the subroutines given in J. Villadsen and\n\ +M. L. Michelsen, @cite{Solution of Differential Equation Models by\n\ +Polynomial Approximation}.\n\ +@end deftypefn") { octave_value_list retval; diff -r 0748b03c3510 -r a4cd1e9d9962 src/DLD-FUNCTIONS/fsolve.cc --- a/src/DLD-FUNCTIONS/fsolve.cc Sat Nov 20 14:52:42 1999 +0000 +++ b/src/DLD-FUNCTIONS/fsolve.cc Sat Nov 20 17:23:01 1999 +0000 @@ -149,16 +149,12 @@ while (0) DEFUN_DLD (fsolve, args, nargout, - "Solve nonlinear equations using Minpack. Usage:\n\ -\n\ - [X, INFO] = fsolve (F, X0)\n\ -\n\ -Where the first argument is the name of the function to call to\n\ -compute the vector of function values. It must have the form\n\ -\n\ - y = f (x)\n\ -\n\ -where y and x are vectors.") + "-*- texinfo -*-\n\ +@deftypefn {Loadable Function} {[@var{x}, @var{info}] =} fsolve (@var{fcn}, @var{x0})\n\ +Given @var{fcn}, the name of a function of the form @code{f (@var{x})}\n\ +and an initial starting point @var{x0}, @code{fsolve} solves the set of\n\ +equations such that @code{f(@var{x}) == 0}.\n\ +@end deftypefn") { octave_value_list retval; @@ -322,10 +318,14 @@ } DEFUN_DLD (fsolve_options, args, , - "fsolve_options (KEYWORD, VALUE)\n\ -\n\ -Set or show options for fsolve. Keywords may be abbreviated\n\ -to the shortest match.") + "-*- texinfo -*-\n\ +@deftypefn {Loadable Function} {} fsolve_options (@var{opt}, @var{val})\n\ +When called with two arguments, this function allows you set options\n\ +parameters for the function @code{fsolve}. Given one argument,\n\ +@code{fsolve_options} returns the value of the corresponding option. If\n\ +no arguments are supplied, the names of all the available options and\n\ +their current values are displayed.\n\ +@end deftypefn") { octave_value_list retval; diff -r 0748b03c3510 -r a4cd1e9d9962 src/DLD-FUNCTIONS/quad.cc --- a/src/DLD-FUNCTIONS/quad.cc Sat Nov 20 14:52:42 1999 +0000 +++ b/src/DLD-FUNCTIONS/quad.cc Sat Nov 20 17:23:01 1999 +0000 @@ -117,25 +117,38 @@ while (0) DEFUN_DLD (quad, args, nargout, - "[V, IER, NFUN] = quad (F, A, B [, TOL] [, SING])\n\ + "-*- texinfo -*-\n\ +@deftypefn {Loadable Function} {[@var{v}, @var{ier}, @var{nfun}, @var{err}] =} quad (@var{f}, @var{a}, @var{b}, @var{tol}, @var{sing})\n\ +Integrate a nonlinear function of one variable using Quadpack.\n\ +The first argument is the name of the function to call to compute the\n\ +value of the integrand. It must have the form\n\ \n\ -Where the first argument is the name of the function to call to\n\ -compute the value of the integrand. It must have the form\n\ +@example\n\ +y = f (x)\n\ +@end example\n\ \n\ - y = f (x)\n\ -\n\ -where y and x are scalars.\n\ +@noindent\n\ +where @var{y} and @var{x} are scalars.\n\ \n\ The second and third arguments are limits of integration. Either or\n\ both may be infinite.\n\ \n\ -The optional argument tol is a vector that specifies the desired\n\ +The optional argument @var{tol} is a vector that specifies the desired\n\ accuracy of the result. The first element of the vector is the desired\n\ absolute tolerance, and the second element is the desired relative\n\ -tolerance.\n\ +tolerance. To choose a relative test only, set the absolute\n\ +tolerance to zero. To choose an absolute test only, set the relative\n\ +tolerance to zero. \n\ \n\ The optional argument @var{sing} is a vector of values at which the\n\ -integrand is singular.") +integrand is known to be singular.\n\ +\n\ +The result of the integration is returned in @var{v} and @var{ier}\n\ +contains an integer error code (0 indicates a successful integration).\n\ +The value of @var{nfun} indicates how many function evaluations were\n\ +required, and @var{err} contains an estimate of the error in the\n\ +solution.\n\ +@end deftypefn") { octave_value_list retval; @@ -379,10 +392,14 @@ } DEFUN_DLD (quad_options, args, , - "quad_options (KEYWORD, VALUE)\n\ -\n\ -Set or show options for quad. Keywords may be abbreviated\n\ -to the shortest match.") + "-*- texinfo -*-\n\ +@deftypefn {Loadable Function} {} quad_options (@var{opt}, @var{val})\n\ +When called with two arguments, this function allows you set options\n\ +parameters for the function @code{quad}. Given one argument,\n\ +@code{quad_options} returns the value of the corresponding option. If\n\ +no arguments are supplied, the names of all the available options and\n\ +their current values are displayed.\n\ +@end deftypefn") { octave_value_list retval; diff -r 0748b03c3510 -r a4cd1e9d9962 src/defaults.cc --- a/src/defaults.cc Sat Nov 20 14:52:42 1999 +0000 +++ b/src/defaults.cc Sat Nov 20 17:23:01 1999 +0000 @@ -416,7 +416,13 @@ symbols_of_defaults (void) { DEFVAR (EDITOR, Veditor, editor, - "name of the editor to be invoked by the edit_history command"); + "-*- texinfo -*-\n\ +@defvr {Built-in Variable} EDITOR\n\ +A string naming the editor to use with the @code{edit_history} command.\n\ +If the environment variable @code{EDITOR} is set when Octave starts, its\n\ +value is used as the default. Otherwise, @code{EDITOR} is set to\n\ +@code{\"emacs\"}.\n\ +@end defvr"); DEFVAR (EXEC_PATH, Vexec_path, exec_path, "-*- texinfo -*-\n\ diff -r 0748b03c3510 -r a4cd1e9d9962 src/mappers.cc --- a/src/mappers.cc Sat Nov 20 14:52:42 1999 +0000 +++ b/src/mappers.cc Sat Nov 20 17:23:01 1999 +0000 @@ -560,7 +560,7 @@ DEFUN_MAPPER (toupper, xtoupper, 0, 0, 0, 0, 0, 0.0, 0.0, 2, "-*- texinfo -*-\n\ -@deftypefn {Function File} {} toupper (@var{s})\n\ +@deftypefn {Built-in Function} {} toupper (@var{s})\n\ Return a copy of the string @var{s}, with each lower-case character\n\ replaced by the corresponding upper-case one; nonalphabetic characters\n\ are left unchanged. For example,\n\ diff -r 0748b03c3510 -r a4cd1e9d9962 src/pt-plot.cc --- a/src/pt-plot.cc Sat Nov 20 14:52:42 1999 +0000 +++ b/src/pt-plot.cc Sat Nov 20 17:23:01 1999 +0000 @@ -937,7 +937,18 @@ } DEFUN (clearplot, , , - "clearplot (): clear the plot window") + "-*- texinfo -*-\n\ +@deftypefn {Built-in Function} {} clearplot\n\ +@deftypefnx {Built-in Function} {} clg\n\ +Clear the plot window and any titles or axis labels. The name\n\ +@code{clg} is aliased to @code{clearplot} for compatibility with\n\ +@sc{Matlab}.\n\ +\n\ +The commands @kbd{gplot clear}, @kbd{gsplot clear}, and @kbd{replot\n\ +clear} are equivalent to @code{clearplot}. (Previously, commands like\n\ +@kbd{gplot clear} would evaluate @code{clear} as an ordinary expression\n\ +and clear all the visible variables.)\n\ +@end deftypefn") { octave_value_list retval; send_to_plot_stream ("clear\n"); @@ -963,7 +974,11 @@ DEFALIAS (clg, clearplot); DEFUN (closeplot, , , - "closeplot (): close the stream to plotter") + "-*- texinfo -*-\n\ +@deftypefn {Built-in Function} {} closeplot\n\ +Close stream to the @code{gnuplot} subprocess. If you are using X11,\n\ +this will close the plot window.\n\ +@end deftypefn") { octave_value_list retval; close_plot_stream (); @@ -971,10 +986,22 @@ } DEFUN_TEXT (hold, args, , - "hold [on|off]\n\ + "-*- texinfo -*-\n\ +@deftypefn {Built-in Function} {} hold @var{args}\n\ +Tell Octave to `hold' the current data on the plot when executing\n\ +subsequent plotting commands. This allows you to execute a series of\n\ +plot commands and have all the lines end up on the same figure. The\n\ +default is for each new plot command to clear the plot device first.\n\ +For example, the command\n\ \n\ -determine whether the plot window is cleared before the next line is\n\ -drawn. With no argument, toggle the current state.") +@example\n\ +hold on\n\ +@end example\n\ +\n\ +@noindent\n\ +turns the hold state on. An argument of @code{off} turns the hold state\n\ +off, and @code{hold} with no arguments toggles the current hold state.\n\ +@end deftypefn") { octave_value_list retval; @@ -1009,15 +1036,28 @@ } DEFUN (ishold, , , - "ishold\n\ -\n\ -Return 1 if hold is on, otherwise return 0.") + "-*- texinfo -*-\n\ +@deftypefn {Built-in Function} {} ishold\n\ +Return 1 if the next line will be added to the current plot, or 0 if\n\ +the plot device will be cleared before drawing the next line.\n\ +@end deftypefn") { return static_cast (! clear_before_plotting); } DEFUN (purge_tmp_files, , , - "delete temporary data files used for plotting") + "-*- texinfo -*-\n\ +@deftypefn {Built-in Function} {} purge_tmp_files\n\ +Delete the temporary files created by the plotting commands.\n\ +\n\ +Octave creates temporary data files for @code{gnuplot} and then sends\n\ +commands to @code{gnuplot} through a pipe. Octave will delete the\n\ +temporary files on exit, but if you are doing a lot of plotting you may\n\ +want to clean up in the middle of a session.\n\ +\n\ +A future version of Octave will eliminate the need to use temporary\n\ +files to hold the plot data.\n\ +@end deftypefn") { octave_value_list retval; cleanup_tmp_files (); @@ -1241,10 +1281,20 @@ symbols_of_pt_plot (void) { DEFVAR (automatic_replot, 0.0, automatic_replot, - "if true, auto-insert a replot command when a plot changes"); + "-*- texinfo -*-\n\ +@defvr {Built-in Variable} automatic_replot\n\ +You can tell Octave to redisplay the plot each time anything about it\n\ +changes by setting the value of the builtin variable\n\ +@code{automatic_replot} to a nonzero value. Since this is fairly\n\ +inefficient, the default value is 0.\n\ +@end defvr"); DEFVAR (gnuplot_binary, "gnuplot", gnuplot_binary, - "path to gnuplot binary"); + "-*- texinfo -*-\n\ +@defvr {Built-in Variable} gnuplot_binary\n\ +The name of the program invoked by the plot command. The default value\n\ +is @code{\"gnuplot\"}. @xref{Installation}.\n\ +@end defvr"); DEFVAR (gnuplot_command_plot, "pl", gnuplot_command_plot, ""); @@ -1277,7 +1327,14 @@ #endif DEFVAR (gnuplot_has_frames, with_frames, gnuplot_has_frames, - "true if gnuplot supports multiple plot windows on X11, false otherwise"); + "-*- texinfo -*-\n\ +@defvr {Built-in Variable} gnuplot_has_frames\n\ +If the value of this variable is nonzero, Octave assumes that your copy\n\ +of gnuplot has support for multiple frames that is included in recent\n\ +3.6beta releases. It's initial value is determined by configure, but it\n\ +can be changed in your startup script or at the command line in case\n\ +configure got it wrong, or if you upgrade your gnuplot installation.\n\ +@end defvr"); #ifdef GNUPLOT_HAS_MULTIPLOT double with_multiplot = 1.0; @@ -1286,7 +1343,15 @@ #endif DEFVAR (gnuplot_has_multiplot, with_multiplot, gnuplot_has_multiplot, - "true if gnuplot supports multiplot, false otherwise"); + "-*- texinfo -*-\n\ +@defvr {Built-in Variable} gnuplot_has_multiplot\n\ +If the value of this variable is nonzero, Octave assumes that your copy\n\ +of gnuplot has the multiplot support that is included in recent\n\ +3.6beta releases. It's initial value is determined by configure, but it\n\ +can be changed in your startup script or at the command line in case\n\ +configure got it wrong, or if you upgrade your gnuplot installation.\n\ +@end defvr"); + } /*