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

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

There is a slight philosophical difference that has developed between Octave
and Matlab.  Octave has generally been checking its inputs more rigorously in
order to avoid Garbage In/Garbage Out calculations.  Matlab behaves a bit more
like Perl in that it assumes the programmer is correct regardless of how
strange the request may be.

Both approaches are valid, but it would be best to choose an overall approach
rather than having some functions be lax and others strict.  My personal
preference is for the stricter interpretation.  In this case, why doesn't the
programmer know enough about their input data not to overstep the dimensions? 
Shouldn't they be checking for that?  There is no reason to call mean on the
non-existent dimension since it will just return the original matrix.

We are not slavish to Matlab compatibility where it looks unnecessary. 
However, if we want to adopt Matlab's laissez-faire philosophy we should do so
more generally.  A quick grep shows that the code snippet which checks
dimensions is used 18 times in the statistics/base directory and 8 other
places in the scripts directory.  These would also need updating.


    _______________________________________________________

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]