ComplexVector
Converts an object to a complex vector.
Syntax
-
ComplexVector(X)
-
X
is any object
-
Description
If X
is any object, then ComplexVector(X)
returns X
as a complex vector, if possible.
Specifically,
-
If
X
is number, thenComplexVector(X)
returns the one-dimensional vector with single componentX
. -
If
X
is a real or complex vector, thenComplexVector(X)
returnsX
as a complex vector. -
If
X
is a real or complex matrix, thenComplexVector(X)
returns the complex vector containing the entries ofX
in row-major order. -
If
X
is a list of numbers, thenComplexVector(X)
returns the complex vector containing these numbers. If the list contains any non-numbers, they are ignored. -
If
X
is a set of numbers, thenComplexVector(X)
returns a complex vector containing these numbers in undefined order. If the set contains any non-numbers, they are ignored. -
If
X
is a structure containing numbers, thenComplexVector(X)
returns the complex vector containing these numbers. Any non-numbers inX
are ignored. -
If
X
is a string, it is split on comma, semicolon, tab, and linebreaks, in an attempt to parse it as a complex vector.
Examples
ComplexVector(IdentityMatrix(3))
(1, 0, 0, 0, 1, 0, 0, 0, 1)
ComplexVector("1, i, 0, −i, 0")
⎛1 ⎞ ⎜i ⎟ e⎜0 ⎟ ⎜−i⎟ ⎝0 ⎠
See also
-
Type conversion functions (list)