isscalar
Tests if a value is a scalar.
Syntax
R = isscalar(A)
Inputs
- A
- The input to be tested to determine if it is a scalar.
Outputs
- R
- R is a logical value indicating whether A is a scalar.
Example
Scalar example:
R = isscalar(1)
R = 1
Matrix
example:
R = isscalar([1,2;3,4])
R = 0
Logical
example:
R = isscalar(true)
R = 1
Character
example:
R = isscalar('Q')
R = 1