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

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

[Octave-bug-tracker] [bug #51437] mean(zeros(1, 0)) does not return NaN


From: Rik
Subject: [Octave-bug-tracker] [bug #51437] mean(zeros(1, 0)) does not return NaN for Matlab compatibility
Date: Mon, 24 Jul 2017 19:28:06 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:54.0) Gecko/20100101 Firefox/54.0

Follow-up Comment #8, bug #51437 (project octave):

Other languages which are far stronger in statistics, such as R, return NaN
for the case of empty matrices.  Sample R code,


x = matrix (c(1), nrow=3, ncol=0)
mean(x)


It seems more useful mathematically for Octave to return NaN in these cases
rather than occasionally NaN and occasionally a dimensioned empty matrix, even
if there is a rule for when "occasionally" occurs.


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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