Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Multiple Anonymous Functions
Date: Tue, 03 Nov 2009 11:27:31 -0500
Organization: The MathWorks, Inc.
Lines: 22
Message-ID: <hcpllj$nb1$1@fred.mathworks.com>
References: <hcpjp7$o4k$1@fred.mathworks.com>
NNTP-Posting-Host: eddinss-lt.dhcp.mathworks.com
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: fred.mathworks.com 1257265651 23905 172.31.57.98 (3 Nov 2009 16:27:31 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 3 Nov 2009 16:27:31 +0000 (UTC)
User-Agent: Thunderbird 2.0.0.23 (Windows/20090812)
In-Reply-To: <HIDDEN>
Xref: news.mathworks.com comp.soft-sys.matlab:582082


Matthias wrote:
> Hello,
> 
> in the Matlab Help there is an Example for Multiple Anonymous Functions:
> 
> g = @(c)  (quad(@(x) (x.^2 + c*x + 1), 0, 1))
> 
> g(2)
> ans =
>    2.3333
> 
> This works fine. I'd like to be able to call this function with an array of parameters:
> g([1,2,3]) 
> ans = 
>    [g(1), g(2), g(3)] 
> 
> I do not want to use external m-files and for-loops. Is there any way?
> 
> Regards,
> Matthias

arrayfun