[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Loading complex variables???
From: |
Miroslaw Kwasniak |
Subject: |
Re: Loading complex variables??? |
Date: |
Thu, 17 Nov 2005 09:12:28 +0100 |
User-agent: |
Mutt/1.5.9i |
On Wed, Nov 16, 2005 at 04:28:09PM -0600, Larry Blodgett wrote:
> octave:3> zmc=complex(zmcr,zmci)
> zmc = 4 + 5i
>
> This complex notation is not in the book but it works (am I wrong?).
> At my home octave does not accept the complex statement.
>
> I had to use zmc=zmcr+j*zmci
Other answered about complex() function and I have only a small remark - if
you use the second form octave provides at startup four predefined names:
octave2.9:2> [ i j I J] ans =
0 + 1i 0 + 1i 0 + 1i 0 + 1i
but they can be redefined as normal variables (I often use i,j as loop
variables) - it's safer to use a "numeric" i:
zmc = zmcr + 1i * zmci
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------