help-octave
[Top][All Lists]
Advanced

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

Re: Is there a way to let @ defined function handle return multiple valu


From: Ben Abbott
Subject: Re: Is there a way to let @ defined function handle return multiple values?
Date: Mon, 01 Jul 2013 05:32:50 +0000 (GMT)

On Jun 30, 2013, at 11:34 PM, Peng Yu <address@hidden> wrote:

Hi,

http://www.gnu.org/software/octave/doc/interpreter/Function-Handles.html

I only see @ can be used to define function handles with one return
value. Is it possible to define a function handle to return two
values? Thanks.
 
I assume you're asking about in-line functions?   For that, use deal().  A trivial example is below.

fun = @(x,y) deal (x, y);

[a, b] = fun (1, 2)

a =  1

b =  2


Ben 

reply via email to

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