ComplexMatrix
Converts an object to a complex matrix.
Syntax
-
ComplexMatrix(X)
-
X
is any object
-
Description
If X
is any object, then ComplexMatrix(X)
returns X
as a complex matrix, if possible.
Specifically,
-
If
X
is a number, thenComplexMatrix(X)
returns the 1×1 complex matrix containingX
as its only entry. -
If
X
is a vector, thenComplexMatrix(X)
returnsX
as a single-column complex matrix. -
If
X
is a matrix, thenComplexMatrix(X)
returnsX
as a complex matrix. -
If
X
is a two-dimensional list of numbers, thenComplexMatrix(X)
returnsX
as a complex matrix. -
If
X
is a string, thenComplexMatrix(X)
attempts to parse it as a complex matrix by splitting it on newlines (rows) and commas, semicolons, and tabs (columns).
Examples
ComplexMatrix(❨4, i, 2❩)
⎛4⎞ ⎜i⎟ ⎝2⎠
ComplexMatrix("1 + i, 2 − 2⋅i, 3 + 2⋅i"~¶~"5, 6 − 3⋅i, i")
⎛ 1 + i 2 − 2⋅i 3 + 2⋅i⎞ ⎝ 5 6 − 3⋅i i⎠
ComplexMatrix(compute(√(a⋅b), a, −2, 2, b, −2, 2))
⎛ 2 1.41421356237 0 1.41421356237⋅i 2⋅i⎞ ⎜ 1.41421356237 1 0 i 1.41421356237⋅i⎟ ⎜ 0 0 0 0 0⎟ ⎜1.41421356237⋅i i 0 1 1.41421356237⎟ ⎝ 2⋅i 1.41421356237⋅i 0 1.41421356237 2⎠
See also
-
Type conversion functions (list)