help-octave
[Top][All Lists]
Advanced

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

Re: Opinions on Matlab compatibility, Octave development


From: Francesco Potortì
Subject: Re: Opinions on Matlab compatibility, Octave development
Date: Mon, 07 Jun 2010 12:54:23 +0200

>3) Code obfuscation is not helpful. Here is an example:
>
>   dim = [find(size (a) != 1, 1), 1](1); # First non-singleton dim.
>
>What is the purpose of such constructs? The same is done by
>
>   dim = find(size (a) != 1, 1);
>
>The only reason for doing this is to make it more difficult to use it
>within Matlab - because Oct2mat does not support the translation. You
>can find this example in the code of center.m, and the same code was
>also part of median.m until a few day ago.

Those two lines behave differently when a has no non-singleton
dimension.  The first one returns 1, while the second one returns an
empty matrix.  I suppose the first one was intentionally written to
return 1 in these cases.

-- 
Francesco Potortì (ricercatore)        Voice: +39 050 315 3058 (op.2111)
ISTI - Area della ricerca CNR          Fax:   +39 050 315 2040
via G. Moruzzi 1, I-56124 Pisa         Email: address@hidden
(entrance 20, 1st floor, room C71)     Web:   http://fly.isti.cnr.it/


reply via email to

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