changeset 31924:b6e0171c3f44

maint: merge stable to default
author Rik <rik@octave.org>
date Fri, 24 Mar 2023 08:40:35 -0700
parents c735cce18c7a (current diff) 073cc98750c6 (diff)
children cd5be42a81ab
files libinterp/corefcn/data.cc
diffstat 2 files changed, 18 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/data.cc	Thu Mar 23 16:22:59 2023 -0400
+++ b/libinterp/corefcn/data.cc	Fri Mar 24 08:40:35 2023 -0700
@@ -5602,10 +5602,10 @@
 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.
+If the number of elements @var{n} 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 @var{n} 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
@@ -5613,8 +5613,11 @@
 each row is an independent sequence between
 @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.
+Programming Notes: For compatibility with @sc{matlab}, return the second
+argument (@var{end}) when a single value (@var{n} = 1) is requested.  If
+@var{n} is not an integer then @code{floor (@var{n})} is used to round the
+number of elements.  If @var{n} is zero or negative then an empty 1x0 matrix
+is returned.
 @seealso{colon, logspace}
 @end deftypefn */)
 {
--- a/scripts/general/logspace.m	Thu Mar 23 16:22:59 2023 -0400
+++ b/scripts/general/logspace.m	Fri Mar 24 08:40:35 2023 -0700
@@ -26,6 +26,7 @@
 ## -*- texinfo -*-
 ## @deftypefn  {} {@var{y} =} logspace (@var{a}, @var{b})
 ## @deftypefnx {} {@var{y} =} logspace (@var{a}, @var{b}, @var{n})
+## @deftypefnx {} {@var{y} =} logspace (@var{a}, pi)
 ## @deftypefnx {} {@var{y} =} logspace (@var{a}, pi, @var{n})
 ## Return a row vector with @var{n} elements logarithmically spaced from
 ## @tex
@@ -35,7 +36,7 @@
 ## 10^@var{a} to 10^@var{b}.
 ## @end ifnottex
 ##
-## If @var{n} is unspecified it defaults to 50.
+## If the number of elements @var{n} is unspecified it defaults to 50.
 ##
 ## If @var{b} is equal to
 ## @tex
@@ -58,17 +59,20 @@
 ## @ifnottex
 ## 10^@var{a} and 10^pi,
 ## @end ifnottex
-## in order to be compatible with the corresponding @sc{matlab} function.
+## which is useful in digital signal processing.
 ##
-## Also for compatibility with @sc{matlab}, return the right-hand side of
-## the range
+## Programming Notes: 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.
+## when a single value (@var{n} = 1) is requested.
+## If @var{n} is not an integer then @code{floor (@var{n})} is used to round
+## the number of elements.  If @var{n} is zero or negative then an empty 1x0
+## matrix is returned.
 ## @seealso{linspace}
 ## @end deftypefn