Mercurial > hg > octave-lyh
changeset 14442:c1f9b54350f9
doc: improve description of functions and scripts
* func.txi: Enumerate all the ways that functions can be defined.
author | Doug Stewart <doug.dastew@gmail.com> |
---|---|
date | Fri, 24 Feb 2012 20:42:29 -0500 |
parents | b06010f12183 |
children | 47fba1dc31b8 |
files | doc/interpreter/func.txi |
diffstat | 1 files changed, 26 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/doc/interpreter/func.txi +++ b/doc/interpreter/func.txi @@ -29,6 +29,7 @@ like built-in functions. @menu +* Introduction to Function and Script Files:: * Defining Functions:: * Multiple Return Values:: * Variable-length Argument Lists:: @@ -43,6 +44,31 @@ * Organization of Functions:: @end menu +@node Introduction to Function and Script Files +@section Introduction to Function and Script Files + +There are six different things covered in this section. +@enumerate +@item +Typing in a function at the command prompt. +@item +Storing a group of commands in a file - called a script file. +@item +Storing a function in a file - called a function file. +@item +Sub-functions in function files. +@item +Multiple functions in one script file. +@item +Private functions. +@end enumerate + +Both function files and script files end with an extension of .m, for +@sc{Matlab} compatibility. If you want more than one independent +functions in a file, it must be a script file (@pxref{Script Files}), +and to use these functions you must execute the script file before you +can use the functions that are in the script file. + @node Defining Functions @section Defining Functions @cindex @code{function} statement