From: "Steven_Lord" <>
Newsgroups: comp.soft-sys.matlab
Subject: Re: coping with "no indexing of function calls"
Date: Fri, 31 May 2013 09:55:07 -0400
Organization: MathWorks
Lines: 29
Message-ID: <koaa3r$nbm$>
References: <ko7tn0$5n$> <ko83qf$4fo$> <ko8b4g$ojc$>
Mime-Version: 1.0
Content-Type: text/plain;
Content-Transfer-Encoding: 7bit
X-Trace: 1370008507 23926 (31 May 2013 13:55:07 GMT)
NNTP-Posting-Date: Fri, 31 May 2013 13:55:07 +0000 (UTC)
In-Reply-To: <ko8b4g$ojc$>
X-Priority: 3
X-MSMail-Priority: Normal
Importance: Normal
X-Newsreader: Microsoft Windows Live Mail 14.0.8089.726
X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726
Xref: comp.soft-sys.matlab:796482

"kj" <> wrote in message 
> In <ko83qf$4fo$> "Steven_Lord" 
> <> writes:


>>You could write a function that accepts the temporary output from the
>>function and the indices and extract just those elements of the temporary
>>extractCertainElementsFromOneOutputFunction = @(tmp, index) tmp(index);
>>A = extractCertainElementsFromOneOutputFunction(foo(B), 1)
> I really like this idea.  In fact, I don't see why it has to be a
> temporary function.

It doesn't have to be. I wrote it as an anonymous function because it was 
less typing than defining a "named" function, although the fact that I used 
a 43 character variable name probably negated that advantage ;)

Steve Lord
To contact Technical Support use the Contact Us link on