bug in imag()

Dmitri A. Sergatskov dasergatskov at gmail.com
Mon Dec 15 18:24:10 CST 2008


On Mon, Dec 15, 2008 at 6:01 PM, Luca Lanci <luca.lanci at uniurb.it> wrote:
> Strange behaviour of function imag()
>
>
> ------------
> GNU Octave, version 3.0.1
> Copyright (C) 2008 John W. Eaton and others.
> This is free software; see the source code for copying conditions.
> There is ABSOLUTELY NO WARRANTY; not even for MERCHANTIBILITY or
> FITNESS FOR A PARTICULAR PURPOSE.  For details, type `warranty'.
>
> Octave was configured for "i386-apple-darwin8.9.1".
>
> octave-3.0.1:43> a=complex(2,5)
> a =  2 + 5i
> octave-3.0.1:44> real(a)
> ans =  2
> octave-3.0.1:45> imag(a)
> error: complex scalar type invalid as index value    <--?????

You probably have executed ode that defines matrix imag(). E.g.:


octave:1> a=complex(2,5)
a =  2 + 5i
octave:2> real(a)
ans =  2
octave:3> imag(a)
ans =  5
octave:4> imag=zeros(10);
octave:5> imag(a)
error: complex scalar type invalid as index value

>
> Regards, luca
>

Dmitri.
--


More information about the Bug-octave mailing list