help-octave
[Top][All Lists]
Advanced

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

Re: varargout{:} = func() ?


From: Ben Abbott
Subject: Re: varargout{:} = func() ?
Date: Tue, 23 Feb 2010 19:59:24 -0500

On Feb 23, 2010, at 7:43 PM, WS wrote:

> Has this notation been implemented in octave yet?
> 
> Tx

hmmm ... if you mean something like what is below, then yes.

function varargout = foobar ( )
  for n = 1:numel(nargout)
    varargout{n} = n;
  end
end

In this instance "varargout" has a special meaning.

If you mean, something like what is below, then that doesn't work with 3.2.x, 
but does with Matlab.

        v{:} = {rand(1,2), rand(1,3)}
        error: invalid dimension inquiry of a non-existent value

or

        v{:} = rand(1,2)
        error: invalid dimension inquiry of a non-existent value 

Jarsolav, is this something that should be added to Octave?

Ben



reply via email to

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