getMatrixDataType#
Find the data type of all elements in a matrix or array, for example "number" if all items are a number and "Complex" if all values are complex numbers. If a matrix contains more than one data type, it will return "mixed".
Available in: math cells, REPL.
Syntax#
getMatrixDataType(x)
Arguments and behavior#
For matrices, dimensions must match the operation. Singular matrices or incompatible shapes can fail. Cell indexing starts at 1. The example returns scalar (string).
Example#
Edit the inputs, then use Run or Reset. Changes stay in this example.
Example
getMatrixDataType(matrix([[1,2],[3,4]]))Interactive examples could not load. You can still copy the expressions.
Expected result: "number".