[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: at-sign in function call
From: |
David Bateman |
Subject: |
Re: at-sign in function call |
Date: |
Wed, 14 Jun 2006 14:18:07 +0200 |
User-agent: |
Mozilla Thunderbird 1.0.6-7.6.20060mdk (X11/20050322) |
Wolfgang Lindner wrote:
>Dear Octaver's,
>
>I came across the following call in a file written for 'TheOther'LAB:
>
>mu = 2; sigma = 1;
>x = normrnd(mu, sigma, 1, 10)
>k = (1:1:10)
>anfMu = 0;
>[MU, R, J] = nlinfit(k, x, @constMu, anfMu)
> ^^^^^^^^
> [1]
>where
> function [values] = constMu(mu, x)
> values = mu*ones(size(x));
>
>As far I as can see [1] invokes only a user defined function.
>Using octave 2.1.50 the use of @ in a name produces an error.
>
>Q: what is the meaning of @?
>
>
This is a function handle.
> Is it sufficent to use e.g. an inline-function in octave?
> Or is there a special idea behind the @-constuction and is there
> an octave eqivalent or a work around?
>
>
Yes in both recent 2.1.x versions and all 2.9.x versions.
> What are your recommendations?
>
>
use a newer version of octave..
D.
--
David Bateman address@hidden
Motorola Labs - Paris +33 1 69 35 48 04 (Ph)
Parc Les Algorithmes, Commune de St Aubin +33 6 72 01 06 33 (Mob)
91193 Gif-Sur-Yvette FRANCE +33 1 69 35 77 01 (Fax)
The information contained in this communication has been classified as:
[x] General Business Information
[ ] Motorola Internal Use Only
[ ] Motorola Confidential Proprietary