octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #33523] Matlab compatibility issue with averag


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #33523] Matlab compatibility issue with averaging the 3rd dim of a 2-D array
Date: Fri, 29 Jun 2012 19:27:02 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.5) Gecko/20100101 Firefox/10.0.5 Iceweasel/10.0.5

Follow-up Comment #15, bug #33523 (project octave):

You can certainly make a solid argument that stripping trailing singletons was
a design mistake for Matlab. but given that behavior, I don't think it is
reasonable to require that programmers write a lot of extra code to cope with
it.  Should we also error for things like


x = rand (m, n, p);
x(:,:,1)


if p happens to be 1?  In that case ndims(x) == 2.  So should it also be an
error to use more than two indices even if all the extra indices are equal to
1?

Should sum(x,3) also be an error in this case?  What about size(x,3)?  Both of
these are currently valid in Matlab and Octave now.  So why shouldn't the mean
function allow sum(x,3)/size(x,3) to work?

Unless you also want to make all these other operations produce errors, I
don't see why it makes sense for the stats functions to produce errors for
similar cases.

If you make all of those cases errors, you will significantly reduce Matlab
compatibility.  I don't see that as a good thing to do.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?33523>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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