help-octave
[Top][All Lists]
Advanced

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

Re: How to get the help of @?


From: Peng Yu
Subject: Re: How to get the help of @?
Date: Fri, 31 Aug 2012 11:53:01 -0500

On Fri, Aug 31, 2012 at 11:48 AM, Jordi Gutiérrez Hermoso
<address@hidden> wrote:
> On 31 August 2012 12:41, Peng Yu <address@hidden> wrote:
>> help('@') does not show anything in octave, but it shows the document
>> in matlab. Could anybody how to get to the document of '@' from
>> command line?
>
> What document? It probably just isn't written for Octave. Can you
> write it? Do not use the Matlab document as a starting point.

The following is found from octave pdf document. They can be readily
added to help('@').

A function handle is a pointer to another function and is defined with
the syntax
@function-name
For example,
f = @sin;
creates a function handle called f that refers to the function sin.
Function handles are used to call other functions indirectly, or to
pass a function as an
argument to another function like quad or fsolve. For example:
f = @sin;
quad (f, 0, pi)
) 2
You may use feval to call a function using function handle, or simply
write the name
of the function handle followed by an argument list. If there are no
arguments, you must
use an empty argument list ‘()’. For example:
f = @sin;
feval (f, pi/4)
) 0.70711
f (pi/4)
) 0.70711

-- 
Regards,
Peng


reply via email to

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