On 28 April 2011 22:42, Muhali <muh...@shaw.ca> wrote: >> octave-3.2.4:11> b = [2 5 NaN 7]; >> octave-3.2.4:13> cumsum(b) >> ans = >> >> 2 7 NaN NaN > > I would expect it to do > > octave:> nancumsum(b) > > 2 7 7 14
Again, I'm sorry if this is wrong but I'm but a biologist, very little background on maths. If my understanding is correct NaN == undefined. If you add something to undefined, shouldn't it be undefined as well? If so, all values beyond a NaN ocurrence will be NaN in a cumsum. Undefined is not the same as 0 which seems to be the behavior you expect. Carnë ------------------------------------------------------------------------------ WhatsUp Gold - Download Free Network Management Software The most intuitive, comprehensive, and cost-effective network management toolset available today. Delivers lowest initial acquisition cost and overall TCO of any competing solution. http://p.sf.net/sfu/whatsupgold-sd _______________________________________________ Octave-dev mailing list Octave-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/octave-dev