# HG changeset patch # User Arun Giridhar # Date 1665762520 14400 # Node ID cf90a6c8dae7bdcb3a04c238327f18d4e1530356 # Parent 59f2f8b6b61bb5e3e96abad3719d1f8367ab3a75 doc: Minor additions and copyedits to function documentation diff -r 59f2f8b6b61b -r cf90a6c8dae7 doc/interpreter/func.txi --- a/doc/interpreter/func.txi Fri Oct 14 11:00:01 2022 -0400 +++ b/doc/interpreter/func.txi Fri Oct 14 11:48:40 2022 -0400 @@ -263,13 +263,13 @@ @end group @end example -Octave automatically reports an error if you call a function with more -arguments than expected. Octave does not automatically report an error if -you call a function with too few arguments, since functions in general may -have default arguments, but any attempt to use a variable that has not been -given a value will result in an error. To avoid such problems and to provide -useful messages, we can check for such possibilities and issue our own -error messages. +Octave automatically reports an error if a function in a .m file is called +with more arguments than expected. Octave does not automatically report an +error if a function is called with too few arguments, since functions in +general may have default arguments, but any attempt to use a variable that +has not been given a value will result in an error. Functions can check +the arguments they are called with to avoid such problems and to provide +more context-specific error messages. @DOCSTRING(nargin) @@ -386,9 +386,11 @@ built-in variable @code{ans} does not figure in the count of output arguments, so the value of @code{nargout} may be zero. -The @code{svd} and @code{lu} functions are examples of built-in +The @code{svd} and @code{hist} functions are examples of built-in functions that behave differently depending on the value of -@code{nargout}. +@code{nargout}. For example, @code{hist} will draw a histogram when called +with no output variables, but if called with outputs it will return the +frequency counts and/or bin centers without creating a plot. It is possible to write functions that only set some return values. For example, calling the function