# How to specify a complex number in block: vector_source?

Dear Sir,

I am using the built-in block of Vector Source, configured as below:
Output Type = Complex.
Vector = ( 1, 2, 3 )

Then I run the flow graph.
The block sends out 1 + 0i, 2 + 0i, 3 + 0i.

Question:
How to make it sends 1 + 2i ?
(How to configure this at the Vector field?)

Regards,
activecat

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi activecat,

have you just tried the most intuitive options:

Vector = ( 1 + 2j, 2 + 4.0 * 1j, complex(3,-1) )

all three elements work, since this is just python

Greetings,
Marcus

On 08.02.2014 07:28, Activecat wrote:

Regards, activecat

mailing list [email protected]

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEbBAEBAgAGBQJS9dDSAAoJEAFxB7BbsDrLQoAH90doTEEMHoLGH663dc4n+HbP
PauAKme2ZtLzFmmp4jd9cFSdu5KeEro+phwCucONizdl4s9KwrBQu1xDBbe2KDnm
Ms0BEI5UpEvsnC2azCrbm1a8/evceAYuAHN5+NiWF0HVM4vgnzLEb5EF7gFM1SP/
wFN92td9uXNrvcLT5vXe1xXfK0Sl5DmOnTUav5AzYKvscUz5GG5pqjLNeLM4Nf7C
/FRSW2+5/2os9GQiJEVawMe5ynWKhtxH5w3halQfn/1gMUvRzng7LzQxEnn9sA==
=fg4u
-----END PGP SIGNATURE-----

Dear Marcus,

Thanks, it accepts ( complex(1,2), complex(3,4), complex(5,6) ).
The other two are not accepted, message:
name ‘j’ is not defined.

Nevertheless, that is good enough.
Thanks.

Regards,
activecat

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Oh I just realized:
since python is complaining about “j” not being known:
Don’t have a space between “2” and “j”. 2j is a numeric literal,
which python understands, 2 j is a numeric literal (2) and a name (j),
which python can’t understand.

Greetings,
Marcus

On 08.02.2014 08:33, Activecat wrote:

wrote:

Question: How to make it sends 1 + 2i ? (How to configure

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJS9fi0AAoJEAFxB7BbsDrLT9kH/icf6j2LbltF+M7cqX73uG5S
uG+YsMc90k3QE9wOhFQG7mDAivBOUjF2gEmxKavYLHtqXRwAJ0eu7NHif1lcHBgV
7jyrrO6Gqk3cq3pvwM+pI9/hSHyH5l1K+yLnkyNuLrWTScIJqX5y4/EWHTLZcls/
DrP9vpgnsjo0RcVtB0Tv0dWyeyAGYW9r5I8UscFtlgFQlr5XSoHQhwlZy2nPJrLt
dg4AgZuXEdhKzG8pVeJDNhXFsP2VYHThheXtBPTlRqILhtcRaQ8HHminyCp53kdA
Unm4QXUH9cZbToURySxoUd/QvohjOUEmTgGk+OoH7UW2RbCpkq0LU7E7IklDKAI=
=kFhZ
-----END PGP SIGNATURE-----

On Saturday, February 8, 2014, Activecat [email protected] wrote:

Yes, the comma will result in a tuple with a single complex number. No
comma just returns a complex number.

Dear Marcus,

Now I know the reason:

Vector: ( 1 + 4j ) ==> this doesn’t work
Vector: ( 1 + 4j, ) ==> this work!

So there must have a comma if it is one element.
Thanks.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.