[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: function
From: |
Maynard Wright |
Subject: |
Re: function |
Date: |
Sat, 8 Nov 2008 18:58:59 -0800 |
User-agent: |
KMail/1.9.1 |
This is correct. The second paragraph of Section 11.7 of the printed copy of
the "GNU Octave Manual" points out that a script file must not begin with the
keyword "function."
If you add another line before "function" or rearrange the code so that the
function is defined later in the code, but before it is called, you will be
able to define the function in the script file. Adding a line containing a
single one and a semicolon ("1;") to the beginning of the file should
suffice.
Regards,
Maynard Wright
On Saturday 08 November 2008 16:15, Ivan Sutoris wrote:
> Hi
>
> I've tried your example, and I think the problem is that your file
> starts with function definition, so Octave understands it as function,
> not script. You should either put function definition in one file and
> rest of commands in second file (and then run the second file), or put
> some commands before function definition.
>
> Regards
> Ivan Sutoris
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://www-old.cae.wisc.edu/mailman/listinfo/help-octave