|
From: | Doug Stewart |
Subject: | Re: function help |
Date: | Fri, 24 Feb 2012 20:45:57 -0500 |
I propose an introduction section like this.On Fri, Feb 24, 2012 at 11:37 AM, damian.harty <address@hidden> wrote:
No problem, I think some small additions along these lines would really help:
11.1 Defining Functions
> The function body consists of Octave statements. It is the most important
> part of the definition, because it says what the function should actually
> do.
+ The following examples will work when entered directly from the command
prompt. To avoid repeated definition of functions it is convenient to enter
those definitions into files for re-use. Some non-intuitive behaviour can
occur when performing this - see section 11.9 for detail on including
functions inside an m-file. This does not represent a bug and is designed-in
behaviour, but is nevertheless a trap for the uninitiated.
+ Alternatively, individual functions can be stored in their own file of the
same name - the function foo can be stored in foo.m - see section 11.8 for
the difference between a list of commands, which execute identically to the
interactive examples below, and a dedicated /function file/.
> For example, here is a function that, when executed, will ring the
> bell...etc
Any use?
View this message in context: http://octave.1599824.n4.nabble.com/function-help-tp4414098p4417830.html
Damian
-----
Senior Research Fellow - Vehicle & System Dynamics
Coventry University
United Kingdom
--
Sent from the Octave - General mailing list archive at Nabble.com.
_______________________________________________
Help-octave mailing list
address@hidden
https://mailman.cae.wisc.edu/listinfo/help-octave
This would be at the start of the chapter.@node Introduction to Function and Scipt Files@section Introduction to Function and Scipt FilesThere are six different things covered in this section.1) Typing in a function at the command prompt.2) Storing a group of commands in a file - called a script file.3) Storing a function in a file - called a function file.4) Sub-functions in function files.5) Multiple functions in one script file.6) Private functions.Both function files and script files end with an extension of .mIf you want more than one independent functions in a file itmust be a script file, and to use these functions you must executethe script file before you can use the functions that are inthe script file.--DAShttps://linuxcounter.net/user/206392.html
[Prev in Thread] | Current Thread | [Next in Thread] |