help-octave
[Top][All Lists]
Advanced

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

Re: Synonym


From: Thomas D. Dean
Subject: Re: Synonym
Date: Wed, 8 Apr 2020 19:52:40 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1

On 2020-04-08 12:02, John W. Eaton wrote:
On 4/8/20 12:59 PM, Tony Richardson wrote:

I've noticed that the two cases:
    varargout = cell (nargout, 1);
    [varargout{:}] = svd(varargin{:});

and
    [varargout{1:nargout}] = svd(varargin{:});

behave differently when called with no output arguments: xsvd(rand(2)).
The first case returns nothing i.e. ans is not set, while the second
case seems to behave normally.

I pushed the following changeset to fix that problem:

   http://hg.savannah.gnu.org/hgweb/octave/rev/56c209ff0a08

jwe



This seems to fail.

octave:20> version("-hgid")
ans = 7ac8b3188b27+
octave:21> function varargout = xsvd (varargin)
>   numel (varargin)
>   [varargout{:}] = svd (varargin{:});
> end
octave:22> xsvd (rand (2))
ans = 1
error: invalid dimension inquiry of a non-existent value
error: called from
    xsvd at line 3 column 18

Or, did I do something wrong?

Tom Dean


reply via email to

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