Mercurial > octave
changeset 24504:5188d936c79a stable
doc: Documentation fixes for linspace, logspace, lookup (bug #52785).
* data.cc (Flinspace): Use "start", "end" as input variables rather than "base"
and "limit". Wrap docstring to 80 characters. Add seealso link to colon.
* data.cc (Fcolon): Add seealso link to linspace.
* logspace.m: Document that when a single value is requested it is the right-hand
limit of range which is returned.
* lookup.cc (Flookup): Rename "val" to "y" which is name of input to function.
author | Rik <rik@octave.org> |
---|---|
date | Wed, 03 Jan 2018 21:49:38 -0800 |
parents | ea1253f05dd3 |
children | 9c178e5252e4 4f0e6ee6c9b8 |
files | libinterp/corefcn/data.cc libinterp/corefcn/lookup.cc scripts/general/logspace.m |
diffstat | 3 files changed, 28 insertions(+), 20 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/corefcn/data.cc Wed Jan 03 21:09:41 2018 -0800 +++ b/libinterp/corefcn/data.cc Wed Jan 03 21:49:38 2018 -0800 @@ -5165,25 +5165,25 @@ DEFUN (linspace, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} linspace (@var{base}, @var{limit}) -@deftypefnx {} {} linspace (@var{base}, @var{limit}, @var{n}) -Return a row vector with @var{n} linearly spaced elements between -@var{base} and @var{limit}. - -If the number of elements is greater than one, then the endpoints @var{base} -and @var{limit} are always included in the range. If @var{base} is greater -than @var{limit}, the elements are stored in decreasing order. If the -number of points is not specified, a value of 100 is used. - -The @code{linspace} function returns a row vector when both @var{base} -and @var{limit} are scalars. If one, or both, inputs are vectors, then +@deftypefn {} {} linspace (@var{start}, @var{end}) +@deftypefnx {} {} linspace (@var{start}, @var{end}, @var{n}) +Return a row vector with @var{n} linearly spaced elements between @var{start} +and @var{end}. + +If the number of elements is greater than one, then the endpoints @var{start} +and @var{end} are always included in the range. If @var{start} is greater than +@var{end}, the elements are stored in decreasing order. If the number of +points is not specified, a value of 100 is used. + +The @code{linspace} function returns a row vector when both @var{start} and +@var{end} are scalars. If one, or both, inputs are vectors, then @code{linspace} transforms them to column vectors and returns a matrix where each row is an independent sequence between -@w{@code{@var{base}(@var{row_n}), @var{limit}(@var{row_n})}}. - -For compatibility with @sc{matlab}, return the second argument (@var{limit}) -if fewer than two values are requested. -@seealso{logspace} +@w{@code{@var{start}(@var{row_n}), @var{end}(@var{row_n})}}. + +For compatibility with @sc{matlab}, return the second argument (@var{end}) when +only a single value (@var{n} = 1) is requested. +@seealso{colon, logspace} @end deftypefn */) { int nargin = args.length (); @@ -6245,6 +6245,7 @@ This function is equivalent to the operator syntax @w{@code{base : limit}} or @w{@code{base : increment : limit}}. +@seealso{linspace} @end deftypefn */) { int nargin = args.length ();
--- a/libinterp/corefcn/lookup.cc Wed Jan 03 21:09:41 2018 -0800 +++ b/libinterp/corefcn/lookup.cc Wed Jan 03 21:49:38 2018 -0800 @@ -219,7 +219,7 @@ @table @code @item m -@code{table(idx(i)) == val(i)} if @code{val(i)} +@code{table(idx(i)) == y(i)} if @code{y(i)} occurs in table; otherwise, @code{idx(i)} is zero. @item b
--- a/scripts/general/logspace.m Wed Jan 03 21:09:41 2018 -0800 +++ b/scripts/general/logspace.m Wed Jan 03 21:49:38 2018 -0800 @@ -53,8 +53,15 @@ ## @end ifnottex ## in order to be compatible with the corresponding @sc{matlab} function. ## -## Also for compatibility with @sc{matlab}, return the second argument @var{b} -## if fewer than two values are requested. +## Also for compatibility with @sc{matlab}, return the right-hand side of +## the range +## @tex +## ($10^{b}$) +## @end tex +## @ifnottex +## (10^@var{b}) +## @end ifnottex +## when just a single value is requested. ## @seealso{linspace} ## @end deftypefn