[Top][All Lists]

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

Re: Aux. functions with multiple outputs

From: Judd Storrs
Subject: Re: Aux. functions with multiple outputs
Date: Fri, 10 Sep 2010 10:08:06 -0400

On Fri, Sep 10, 2010 at 6:22 AM, Mike B. <address@hidden> wrote:
Thanks for replying.
How do I refer to each of the outputs (a and b in the example)?.

I think you might be asking how do I write something like this as an inline function?

function b = myfunc(x)
     [a,b] = somefunc(x) ;

Unfortunately, short of making a wrapper function, I don't know. I think the wrapper function could look something like:

function b = secondout(func, varargin)
    # use [~,b] instead of [a,b] in the development version of octave
    [a,b] = feval(func, varargin{:}) ; 

Then maybe something like:

y = @(x) secondout(@f1, x);


reply via email to

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