Mercurial > hg > octave-avbm
changeset 7989:23c248d415b5
Various doc fixes. Readd cellidx
author | David Bateman <dbateman@free.fr> |
---|---|
date | Tue, 29 Jul 2008 17:01:43 +0200 |
parents | 21904fe299c8 |
children | 86dae6e5b83c |
files | doc/ChangeLog doc/interpreter/numbers.txi doc/interpreter/plot.txi doc/interpreter/quad.txi scripts/ChangeLog scripts/general/cellidx.m scripts/general/quadgk.m scripts/linear-algebra/planerot.m scripts/miscellaneous/namelengthmax.m scripts/specfun/realpow.m src/ChangeLog src/ov-flt-re-mat.cc |
diffstat | 12 files changed, 135 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,5 +1,8 @@ 2008-07-29 David Bateman <dbateman@free.fr> + * interpreter/numbers.txi, interpreter/plot.txi, + interpreter/quad.txi: Miscellaneous documentation fixes. + * control.txi, finance.txi, quaternion.txi: Delete. * octave.texi: Remove all references to the above. * Makefile.in: ditto.
--- a/doc/interpreter/numbers.txi +++ b/doc/interpreter/numbers.txi @@ -681,7 +681,7 @@ returns a single precision value. The mixed operations that are valid and their returned data types are -@multitable @columnfraction .2 .3 .3 .2 +@multitable @columnfractions .2 .3 .3 .2 @item @tab Mixed Operation @tab Result @tab @item @tab double OP single @tab single @tab @item @tab double OP integer @tab integer @tab @@ -690,12 +690,13 @@ @item @tab single OP integer @tab integer @tab @item @tab single OP char @tab single @tab @item @tab single OP logical @tab single @tab +@end multitable The same logic applies to functions with mixed arguments such as @example min (single (1), 0) - @result 0 + @result{} 0 @end example @noindent @@ -708,11 +709,11 @@ x = ones (2, 2); x (1, 1) = single (2) @result{} x = 2 1 - 1 1 + 1 1 @end example @noindent -where @code{x} remains of the double precision. +where @code{x} remains of the double precision type. @node Predicates for Numeric Objects @section Predicates for Numeric Objects
--- a/doc/interpreter/plot.txi +++ b/doc/interpreter/plot.txi @@ -181,6 +181,10 @@ @DOCSTRING(caxis) +@menu +* Two-dimensional Function Plotting:: +@end menu + @node Two-dimensional Function Plotting @subsubsection Two-dimensional Function Plotting @@ -284,8 +288,12 @@ @DOCSTRING(shading) -@node Two-dimensional Function Plotting -@subsubsection Two-dimensional Function Plotting +@menu +* Three-dimensional Function Plotting:: +@end menu + +@node Three-dimensional Function Plotting +@subsubsection Three-dimensional Function Plotting @DOCSTRING(ezplot3)
--- a/doc/interpreter/quad.txi +++ b/doc/interpreter/quad.txi @@ -230,7 +230,7 @@ variables. For example @example -I = dblquad (@(x, y) sin(pi.*x.*y).*sqrt(x.*y), 0, 1, 0, 1) +I = dblquad (@@(x, y) sin(pi.*x.*y).*sqrt(x.*y), 0, 1, 0, 1) @result{} 0.30022 @end example
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,5 +1,11 @@ 2008-07-29 David Bateman <dbateman@free.fr> + * general/cellidx.m: reinclude from control toolbox, as used by + print command. Replace is_signal_list with iscellstr. + * general/quadqk.m, linear-algebra/planeror.m, + miscellaneous/namelengthmax.m, specfun/realpow.m: Miscellaneous + documentation fixes. + * control, finance, quaternion: Remove directories and all of the files they contain. * Makefile.in: Remove all references to the above directories.
new file mode 100644 --- /dev/null +++ b/scripts/general/cellidx.m @@ -0,0 +1,100 @@ +## Copyright (C) 2000, 2004, 2005, 2006, 2007 +## Auburn University. All rights reserved. +## +## This file is part of Octave. +## +## Octave program is free software; you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 3 of the License, or (at +## your option) any later version. +## +## Octave program is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with Octave; see the file COPYING. If not, see +## <http://www.gnu.org/licenses/>. + +## -*- texinfo -*- +## @deftypefn {Function File} {[@var{idxvec}, @var{errmsg}] =} cellidx (@var{listvar}, @var{strlist}) +## Return indices of string entries in @var{listvar} that match strings +## in @var{strlist}. +## +## Both @var{listvar} and @var{strlist} may be passed as strings or +## string matrices. If they are passed as string matrices, each entry +## is processed by @code{deblank} prior to searching for the entries. +## +## The first output is the vector of indices in @var{listvar}. +## +## If @var{strlist} contains a string not in @var{listvar}, then +## an error message is returned in @var{errmsg}. If only one output +## argument is requested, then @var{cellidx} prints @var{errmsg} to the +## screen and exits with an error. +## @end deftypefn + +function [idxvec,errmsg] = cellidx (listvar, strlist) + + if (nargin != 2) + print_usage (); + endif + + if (ischar (strlist)) + tmp = strlist; + strlist = {}; + for kk = 1:rows(tmp) + strlist{kk} = deblank (tmp(kk,:)); + endfor + endif + + if (ischar (listvar)) + tmp = listvar; + listvar = {}; + for kk = 1:rows(tmp) + listvar{kk} = deblank (tmp(kk,:)); + endfor + endif + + ## initialize size of idxvec (for premature return) + idxvec = zeros (length(strlist), 1); + + errmsg = ""; + if (! iscellstr (listvar)) + errmsg = "listvar must be a list of strings"; + elseif (! iscellstr (strlist)) + errmsg = "strlist must be a list of strings"; + endif + + if (length (errmsg)) + if (nargout < 2) + error (errmsg); + else + return; + endif + endif + + nsigs = length(listvar); + for idx = 1:length(strlist) + signame = strlist{idx}; + for jdx = 1:nsigs + if (strcmp (signame, listvar{jdx}) ) + if (idxvec(idx) != 0) + warning ("Duplicate signal name %s (%d,%d)\n", + listvar{jdx}, jdx, idxvec(idx)); + else + idxvec(idx) = jdx; + endif + endif + endfor + if (idxvec(idx) == 0) + errmsg = sprintf ("Did not find %s", signame); + if (nargout == 1) + error (errmsg); + else + break; + endif + endif + endfor + +endfunction
--- a/scripts/general/quadgk.m +++ b/scripts/general/quadgk.m @@ -32,7 +32,7 @@ ## The function @var{f} can be defined in terms of a function handle, ## inline function or string. ## -## The bounds of the quadrature @code{[@var{a}, @var{b}] can be finite +## The bounds of the quadrature @code{[@var{a}, @var{b}]} can be finite ## or infinite and contain weak end singularities. Variable ## transformation will be used to treat infinite intervals and weaken ## the singularities. For example
--- a/scripts/linear-algebra/planerot.m +++ b/scripts/linear-algebra/planerot.m @@ -21,7 +21,7 @@ ## Given a two-element column vector, returns the ## @iftex ## @tex -## $2\\times 2$ orthogonal matrix +## $2 \times 2$ orthogonal matrix ## @end tex ## @end iftex ## @ifnottex
--- a/scripts/miscellaneous/namelengthmax.m +++ b/scripts/miscellaneous/namelengthmax.m @@ -24,7 +24,7 @@ ## @tex ## $2^{31} - 1$ ## @end tex -## @end iftext +## @end iftex ## @ifnottex ## @code{2 ^ 31 - 1} ## @end ifnottex
--- a/scripts/specfun/realpow.m +++ b/scripts/specfun/realpow.m @@ -19,9 +19,9 @@ ## -*- texinfo -*- ## @deftypefn {Function File} {} realpow (@var{x}, @var{y}) ## Return the element by element power operator. This is equivalent to -## @code{@var{x} .^ @var{y}), except that if the return value +## @code{@var{x} .^ @var{y}}, except that if the return value ## is complex @code{realpow} produces an error. -## @seealso{log, reallog, realsqrt} +## @seealso{pow, reallog, realsqrt} ## @end deftypefn function z = realpow (x, y)