ComplexMatrix
Converts an object to a complex matrix.
Syntax
-
ComplexMatrix(X)-
Xis any object
-
Description
If X is any object, then ComplexMatrix(X) returns X as a complex matrix, if possible.
Specifically,
-
If
Xis a number, thenComplexMatrix(X)returns the 1×1 complex matrix containingXas its only entry. -
If
Xis a vector, thenComplexMatrix(X)returnsXas a single-column complex matrix. -
If
Xis a matrix, thenComplexMatrix(X)returnsXas a complex matrix. -
If
Xis a two-dimensional list of numbers, thenComplexMatrix(X)returnsXas a complex matrix. -
If
Xis 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)