comparison libinterp/corefcn/max.cc @ 30888:32d2b6604a9f

doc: Ensure documentation lists output argument when it exists for functions in libinterp/ For new users of Octave it is best to show explicit calling forms in the documentation and to show a return argument when it exists. * __ftp__.cc, __magick_read__.cc, __pchip_deriv__.cc, bitfcns.cc, bsxfun.cc, call-stack.cc, cellfun.cc, chol.cc, conv2.cc, data.cc, debug.cc, defaults.cc, det.cc, dirfns.cc, display.cc, dot.cc, error.cc, event-manager.cc, fft.cc, fft2.cc, fftn.cc, file-io.cc, getgrent.cc, getpwent.cc, getrusage.cc, graphics.cc, hash.cc, help.cc, input.cc, interpreter.cc, kron.cc, load-path.cc, mappers.cc, max.cc, nproc.cc, oct-hist.cc, pager.cc, pinv.cc, psi.cc, rand.cc, settings.cc, sighandlers.cc, stream-euler.cc, strfns.cc, symtab.cc, syscalls.cc, sysdep.cc, time.cc, toplev.cc, utils.cc, variables.cc, __fltk_uigetfile__.cc, audiodevinfo.cc, audioread.cc, fftw.cc, ov-bool-mat.cc, ov-cell.cc, ov-class.cc, ov-classdef.cc, ov-fcn-handle.cc, ov-java.cc, ov-struct.cc, ov-typeinfo.cc, ov-usr-fcn.cc, ov.cc, octave.cc, profiler.cc: Add return arguments to @deftypefn macros where they were missing. Attempt to use standard naming convention for return variables. Occasionally improved the docstring itself by re-wording or adding code examples.
author Rik <rik@octave.org>
date Mon, 04 Apr 2022 10:31:48 -0700
parents 83f9f8bda883
children c9788d7f6e65
comparison
equal deleted inserted replaced
30887:4bab8d3fce79 30888:32d2b6604a9f
438 return retval; 438 return retval;
439 } 439 }
440 440
441 DEFUN (min, args, nargout, 441 DEFUN (min, args, nargout,
442 doc: /* -*- texinfo -*- 442 doc: /* -*- texinfo -*-
443 @deftypefn {} {} min (@var{x}) 443 @deftypefn {} {@var{m} =} min (@var{x})
444 @deftypefnx {} {} min (@var{x}, [], @var{dim}) 444 @deftypefnx {} {@var{m} =} min (@var{x}, [], @var{dim})
445 @deftypefnx {} {[@var{w}, @var{iw}] =} min (@var{x}) 445 @deftypefnx {} {[@var{m}, @var{im}] =} min (@var{x})
446 @deftypefnx {} {} min (@var{x}, @var{y}) 446 @deftypefnx {} {@var{m} =} min (@var{x}, @var{y})
447 Find minimum values in the array @var{x}. 447 Find minimum values in the array @var{x}.
448 448
449 For a vector argument, return the minimum value. For a matrix argument, 449 For a vector argument, return the minimum value. For a matrix argument,
450 return a row vector with the minimum value of each column. For a 450 return a row vector with the minimum value of each column. For a
451 multi-dimensional array, @code{min} operates along the first non-singleton 451 multi-dimensional array, @code{min} operates along the first non-singleton
660 %!error <cannot compute min \(cell, scalar\)> min ({1, 2, 3}, 2) 660 %!error <cannot compute min \(cell, scalar\)> min ({1, 2, 3}, 2)
661 */ 661 */
662 662
663 DEFUN (max, args, nargout, 663 DEFUN (max, args, nargout,
664 doc: /* -*- texinfo -*- 664 doc: /* -*- texinfo -*-
665 @deftypefn {} {} max (@var{x}) 665 @deftypefn {} {@var{m} =} max (@var{x})
666 @deftypefnx {} {} max (@var{x}, [], @var{dim}) 666 @deftypefnx {} {@var{m} =} max (@var{x}, [], @var{dim})
667 @deftypefnx {} {[@var{w}, @var{iw}] =} max (@var{x}) 667 @deftypefnx {} {[@var{m}, @var{im}] =} max (@var{x})
668 @deftypefnx {} {} max (@var{x}, @var{y}) 668 @deftypefnx {} {@var{m} =} max (@var{x}, @var{y})
669 Find maximum values in the array @var{x}. 669 Find maximum values in the array @var{x}.
670 670
671 For a vector argument, return the maximum value. For a matrix argument, 671 For a vector argument, return the maximum value. For a matrix argument,
672 return a row vector with the maximum value of each column. For a 672 return a row vector with the maximum value of each column. For a
673 multi-dimensional array, @code{max} operates along the first non-singleton 673 multi-dimensional array, @code{max} operates along the first non-singleton
991 return retval; 991 return retval;
992 } 992 }
993 993
994 DEFUN (cummin, args, nargout, 994 DEFUN (cummin, args, nargout,
995 doc: /* -*- texinfo -*- 995 doc: /* -*- texinfo -*-
996 @deftypefn {} {} cummin (@var{x}) 996 @deftypefn {} {@var{M} =} cummin (@var{x})
997 @deftypefnx {} {} cummin (@var{x}, @var{dim}) 997 @deftypefnx {} {@var{M} =} cummin (@var{x}, @var{dim})
998 @deftypefnx {} {[@var{w}, @var{iw}] =} cummin (@var{x}) 998 @deftypefnx {} {[@var{M}, @var{IM}] =} cummin (@var{x})
999 Return the cumulative minimum values along dimension @var{dim}. 999 Return the cumulative minimum values along dimension @var{dim}.
1000 1000
1001 If @var{dim} is unspecified it defaults to column-wise operation. For 1001 If @var{dim} is unspecified it defaults to column-wise operation. For
1002 example: 1002 example:
1003 1003
1011 If called with two output arguments the index of the minimum value is also 1011 If called with two output arguments the index of the minimum value is also
1012 returned. 1012 returned.
1013 1013
1014 @example 1014 @example
1015 @group 1015 @group
1016 [w, iw] = cummin ([5 4 6 2 3 1]) 1016 [M, IM] = cummin ([5 4 6 2 3 1])
1017 @result{} 1017 @result{}
1018 w = 5 4 4 2 2 1 1018 M = 5 4 4 2 2 1
1019 iw = 1 2 2 4 4 6 1019 IM = 1 2 2 4 4 6
1020 @end group 1020 @end group
1021 @end example 1021 @end example
1022 1022
1023 @seealso{cummax, min, max} 1023 @seealso{cummax, min, max}
1024 @end deftypefn */) 1024 @end deftypefn */)
1046 %!error cummin (1, 2, 3) 1046 %!error cummin (1, 2, 3)
1047 */ 1047 */
1048 1048
1049 DEFUN (cummax, args, nargout, 1049 DEFUN (cummax, args, nargout,
1050 doc: /* -*- texinfo -*- 1050 doc: /* -*- texinfo -*-
1051 @deftypefn {} {} cummax (@var{x}) 1051 @deftypefn {} {@var{M} =} cummax (@var{x})
1052 @deftypefnx {} {} cummax (@var{x}, @var{dim}) 1052 @deftypefnx {} {@var{M} =} cummax (@var{x}, @var{dim})
1053 @deftypefnx {} {[@var{w}, @var{iw}] =} cummax (@dots{}) 1053 @deftypefnx {} {[@var{M}, @var{IM}] =} cummax (@dots{})
1054 Return the cumulative maximum values along dimension @var{dim}. 1054 Return the cumulative maximum values along dimension @var{dim}.
1055 1055
1056 If @var{dim} is unspecified it defaults to column-wise operation. For 1056 If @var{dim} is unspecified it defaults to column-wise operation. For
1057 example: 1057 example:
1058 1058
1068 1068
1069 @example 1069 @example
1070 @group 1070 @group
1071 [w, iw] = cummax ([1 3 2 6 4 5]) 1071 [w, iw] = cummax ([1 3 2 6 4 5])
1072 @result{} 1072 @result{}
1073 w = 1 3 3 6 6 6 1073 M = 1 3 3 6 6 6
1074 iw = 1 2 2 4 4 4 1074 IM = 1 2 2 4 4 4
1075 @end group 1075 @end group
1076 @end example 1076 @end example
1077 1077
1078 @seealso{cummin, max, min} 1078 @seealso{cummin, max, min}
1079 @end deftypefn */) 1079 @end deftypefn */)