changeset 32583:c273d7fdab3a

doc: Add height and width info to rows and columns docstrings (bug #64995) * /libinterp/coredata.cc (rows, columns): Add deftypefnx and programming notes about height and width aliases. * NEWS.10.md: Note addition of aliases under Matlab Compatibility.
author Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
date Fri, 08 Dec 2023 15:42:52 -0500
parents 9c5b8e82bbae
children d30715f751ce 8c4dfe87d2cf
files etc/NEWS.10.md libinterp/corefcn/data.cc
diffstat 2 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/etc/NEWS.10.md	Mon Dec 11 22:04:31 2023 -0500
+++ b/etc/NEWS.10.md	Fri Dec 08 15:42:52 2023 -0500
@@ -9,6 +9,8 @@
 
 ### Matlab compatibility
 
+- `height` and `width` are now aliases for the `rows` and `columns` functions.
+
 ### Alphabetical list of new functions added in Octave 10
 
 ### Deprecated functions, properties, and operators
--- a/libinterp/corefcn/data.cc	Mon Dec 11 22:04:31 2023 -0500
+++ b/libinterp/corefcn/data.cc	Fri Dec 08 15:42:52 2023 -0500
@@ -2993,9 +2993,14 @@
 DEFUN (rows, args, ,
        doc: /* -*- texinfo -*-
 @deftypefn {} {@var{nr} =} rows (@var{A})
+@deftypefnx () {@var{nr} =} height (@var{A})
 Return the number of rows of @var{A}.
 
 This is equivalent to @code{size (@var{A}, 1)}.
+
+Programming Note: @code{height} is an alias for @code{rows} and either name
+can be used in Octave.
+
 @seealso{columns, size, length, numel, isscalar, isvector, ismatrix}
 @end deftypefn */)
 {
@@ -3040,9 +3045,14 @@
 DEFUN (columns, args, ,
        doc: /* -*- texinfo -*-
 @deftypefn {} {@var{nc} =} columns (@var{A})
+@deftypefnx {} {@var{nc} =} width (@var{A})
 Return the number of columns of @var{A}.
 
 This is equivalent to @code{size (@var{A}, 2)}.
+
+Programming Note: @code{width} is an alias for @code{columns} and either name
+can be used in Octave.
+
 @seealso{rows, size, length, numel, isscalar, isvector, ismatrix}
 @end deftypefn */)
 {