octave-maintainers
[Top][All Lists]
Advanced

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

Re: problem with sum (...)


From: Ben Abbott
Subject: Re: problem with sum (...)
Date: Mon, 5 Nov 2007 21:47:22 -0500


On Nov 5, 2007, at 9:28 PM, Ben Abbott wrote:


On Nov 5, 2007, at 10:16 AM, David Bateman wrote:.

I don't see why matlab should produce an error here.. Adding character
values should be legal, though perhaps a dumb thing to do.. Equally I
don't see why matlab  chose to limit this argument only to the "sum"
function and not also include the "cumsum", "prod", etc functions as
well. In any case consider the attached patch that adds this
functionality to "sum".. Perhaps the other data reduction operators
should also include this functionality?

I'm also bewildered why Mathworks didn't include the 'native' option for other functions ... even more confusing to me is why 'native' isn't the default.

I have no opinion on providing this functionality to the other functions in Octave.

I'm attempting to apply the patch and compile (I'm new to this) ... I'll not have a chance to check on its success until morning. However, your examples produced identical results under Matlab 7.3.0.

Having thought about this further ... isn't the idea of prod (x,'native') equivalent to all(x)?

Regarding cumsum/cumprod, each of these already have optional second arguments; ex: cumsum(x, DIM). So the addition of another optional argument is a bit problematic.

Ben


reply via email to

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