Documentation Center

  • Trials
  • Product Updates

isscalar

Determine whether input is scalar

Syntax

isscalar(A)

Description

isscalar(A) returns logical 1 (true) if size(A) returns [1 1], and logical 0 (false) otherwise.

Examples

Test matrix A and one element of the matrix:

A = rand(5);

isscalar(A)
ans =
     0

isscalar(A(3,2))
ans =
     1

See Also

| | | | | | |

Was this topic helpful?