setdiff output differs from matlab

Sergei Steshenko sergstesh at yahoo.com
Thu Sep 18 05:43:23 CDT 2008




--- On Thu, 9/18/08, David Bateman <David.Bateman at motorola.com> wrote:

> From: David Bateman <David.Bateman at motorola.com>
> Subject: Re: setdiff output differs from matlab
> To: soren at hauberg.org
> Cc: bug at octave.org, "Michael Ferris" <ferris at cs.wisc.edu>, "John W. Eaton" <jwe at bevo.che.wisc.edu>
> Date: Thursday, September 18, 2008, 1:36 AM

[snip]
> So if the args are both vectors, but different orientations
> then Matlab 
> converts them both to be row vectors.
> 
> D.


In the light of David's conclusion could anyone please check how
Matlab copes with the case described here:

http://www.nabble.com/inconsistent-row-<->-column-sub-vector-behavior-td19109349.html

?

John said Matlab would fail too, but since it can correctly guess
how to deal with row <-> column vector in this case, maybe it is smart to
guess correctly also in the case I reported.

John's exact words:

"
It fails because the column vector and the row vector do not have
compatible dimensions. 
",

however, the Email does not contain a copy-pasted Matlab session to
confirm the statement.

My point is that from the point of view of programming it's simpler to
always treat row <-> column vector collision the same way, and I hope
Matlab developers are reasonably lazy to choose this simple way.

Thanks,
  Sergei.


      


More information about the Bug-octave mailing list