ismatrix

Tests if a value is a matrix.

Syntax

R = ismatrix(A)

Inputs

A
The input to be tested to determine if it is a matrix.
Type: double | integer | char | string | logical | struct | cell
Dimension: scalar | string | vector | matrix

Outputs

R
R is a logical value indicating whether A is a matrix. Scalars and strings are considered matrices.

Examples

Scalar example:

R = ismatrix(1)
R = 1
Matrix example:
R = ismatrix([1,2;3,4])
R = 1
Cell example:
R = ismatrix({[1,2;3,4]})
R = 0