octave-maintainers
[Top][All Lists]
Advanced

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

Re: No isimag() curioso


From: Daniel J Sebald
Subject: Re: No isimag() curioso
Date: Sun, 09 Sep 2012 01:35:42 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111108 Fedora/3.1.16-1.fc14 Thunderbird/3.1.16

On 09/08/2012 08:52 PM, Michael D Godfrey wrote:

[snip]

And, this may just add to the noise, but a few days ago I created a
vector which was composed
of complex elements, and some "real" elements, i.e. isreal(x(4)) said 1
and whos x(4) said
it was only 8 bytes.

That is similar to the example:

octave:20> z = complex([1 2 3],[1 0 2])
z =

   1 + 1i   2 + 0i   3 + 2i

octave:21> isreal(z)
ans = 0
octave:22> isreal(z(1))
ans = 0
octave:23> isreal(z(2))
ans =  1
octave:24> whos z z(1) z(2)
Variables in the current scope:

   Attr Name        Size                     Bytes  Class
   ==== ====        ====                     =====  =====
   c    z           1x3                         48  double
   c    z(1)        1x1                         16  double
        z(2)        1x1                          8  double

Total is 5 elements using 72 bytes

...

Interchanging the square and curved parentheses is another, simpler illustration:

octave:28> iscomplex(complex(1,0))
ans =  1
octave:29> iscomplex([complex(1,0)])
ans = 0

Dan



reply via email to

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