octave-maintainers
[Top][All Lists]
Advanced

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

Re: patch for union.m


From: John W. Eaton
Subject: Re: patch for union.m
Date: Fri, 31 Jul 2015 16:35:02 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.7.0

On 07/31/2015 03:31 PM, Juan Pablo Carbajal wrote:

    could you test that indeed this increases compatibility with matlab?

Also, the docs state that if the "rows" argument is not specified, the result should be a column vector unless both arguments are row vectors. So I think union ([], [1,2]) should produce a column vector since [] is not a row vector.

But I guess that behavior changed recently, so the result depends on the version of Matlab. See the description of "legacy" behavior here: http://www.mathworks.com/help/matlab/ref/union.html.

It seems that Rik already made the behavior compatible with current Matlab with this changeset:

  http://hg.savannah.gnu.org/hgweb/octave/rev/72ccbd36e23c

I believe that the change that is under consideration would make the behavior compatible with older versions of Matlab but not newer versions.

I have no desire to start supporting "legacy" options to functions so we can track multiple versions and differing levels of incompatibility. Gah. But then what should we do?

People who want their code to work with Multiple versions of Matlab will already have to cope with this change themselves. So I propose that we only attempt to track the behavior of the latest version of Matlab.

Perhaps we should make the attached change, however, to add tests and remove the redundant calls to isvector.

jwe

Attachment: diffs.txt
Description: Text document


reply via email to

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