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: Rik
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:09:03 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:13.0) Gecko/20100101 Firefox/13.0.1

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

Regarding jwe's example, I think that a trailing singleton dimension is a
special case and it would be better for the programmer to realize it and
program for it.

I'm imagining a case where you might be adding 2-D data sets from various
files into a 3-D array and then taking the mean along the 3rd dimension.  If
there is only one file and only one 2-D data set (p=1) then the entire loop is
unnecessary.  Octave's warning pushes back on the programmer and indicates
that their assumptions were wrong to begin with.

The real use case is when someone types 'mean (x, 12)' on a vector or 2-D
array.  The 12 is a typo, they may have meant 1 or 2 but both keys got hit. 
Currently Octave issues a warning about this being out-of-bounds, but Matlab
will return the original matrix.  Down the line, the script will probably
error out because the dimensions of 'mean (x, 2)' are not the same as those of
x; Only it will be harder to debug because it will be farther from the root
cause of the problem.

    _______________________________________________________

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]