ComplexVector
Converts an object to a complex vector.
Syntax
-
ComplexVector(X)-
Xis any object
-
Description
If X is any object, then ComplexVector(X) returns X as a complex vector, if possible.
Specifically,
-
If
Xis number, thenComplexVector(X)returns the one-dimensional vector with single componentX. -
If
Xis a real or complex vector, thenComplexVector(X)returnsXas a complex vector. -
If
Xis a real or complex matrix, thenComplexVector(X)returns the complex vector containing the entries ofXin row-major order. -
If
Xis a list of numbers, thenComplexVector(X)returns the complex vector containing these numbers. If the list contains any non-numbers, they are ignored. -
If
Xis 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
Xis a structure containing numbers, thenComplexVector(X)returns the complex vector containing these numbers. Any non-numbers inXare ignored. -
If
Xis 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)