Documentation

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
Was this topic helpful?