[OctDev] Function mean() fails with a complex matrix
Jaroslav Hajek
highegg at gmail.com
Thu Mar 5 02:56:49 CST 2009
On Thu, Mar 5, 2009 at 9:31 AM, Alois Schlögl <alois.schloegl at tugraz.at> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
>
> I was digging in my old files and found the attached version of
> sumskipnan for an oct-file. It considers complex numbers, but fails at
> line 198, which should combine he real and the imaginary part in one
> complex matrix. Has anyone a clue how to do this in the correct way ?
>
> Alois
>
Is this function really needed? I mean, stuff like "nansum" can easily
be implemented using something like.
x(isnan(x)) = 0;
y = sum(x,dim)
True, this will make a copy of the matrix, but is that so painful?
Besides, I think the fact that the NaN package shadows Octave's
built-in functions is very dangerous and confusing, even though I
understand the motivation. I think this package should not be
installed by default.
cheers
--
RNDr. Jaroslav Hajek
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz
More information about the Bug-octave
mailing list