setdiff output differs from matlab
John W. Eaton
jwe at bevo.che.wisc.edu
Wed Sep 17 16:44:22 CDT 2008
On 9-Sep-2008, Søren Hauberg wrote:
| tir, 09 09 2008 kl. 13:07 -0500, skrev Michael Ferris:
| > In octave: x = 1:5; y = setdiff(x,x); size(y)
| > ans =
| >
| > 0 0
| >
| > In matlab: x = 1:5; y = setdiff(x,x); size(y)
| > ans =
| >
| > 1 0
|
| Both produce empty matrices, it's only their size that differs.
Yes, but if it makes sense to do so, I think we should try to make the
sizes the same. What does Matlab return for each fo the following,
and does it make sense, or does it just seem like an accident of the
implementation, when it could just as easily return [] in all cases?
x = 1:5;
setdiff (x, x)
setdiff (x', x)
setdiff (x, x')
setdiff (x', x')
Thanks,
jwe
More information about the Bug-octave
mailing list