help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: function syntax


From: Geordie McBain
Subject: Re: function syntax
Date: Mon, 18 Jul 2005 10:40:10 +1000

On Wed, 2005-07-13 at 17:03 +0200, Michael Kopp wrote:
> Hello,
> 
> can anybody give me a hint what the
> 
> @(x) f(x,a,b,c)
> 
> Syntax is all about. Maybe a small example? Google didn't yield anything.
> 
> Thanks in advance,
> 
> Michael.

Hello.  No, google doesn't seem to recognize nonalphanumeric characters.
Also, the mailing list archive at www.octave.org seems to change the
symbol to `at' to obfuscate e-mail addresses.  See, e.g.,

http://www.octave.org/octave-lists/archive/bug-octave.2004/msg00522.html


The symbol @ is the operator to create a function handle; googling on
"function handle" and octave is more successful.

Briefly, for example, to find pi as a root of sine:

octave> f = @ sin;
octave> fzero (f, [2, 4])
ans = 3.1416
octave> 

Hope this helps.
Geordie McBain

> 
> 
> 
> 
> -------------------------------------------------------------
> Octave is freely available under the terms of the GNU GPL.
> 
> Octave's home on the web:  http://www.octave.org
> How to fund new projects:  http://www.octave.org/funding.html
> Subscription information:  http://www.octave.org/archive.html
> -------------------------------------------------------------
> 
> 



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]