isscalar - Determine whether input is scalar
Syntax
TF = isscalar(A)
Description
TF = isscalar(A) returns
logical 1 (true) if A is
a 1-by-1 matrix, and logical 0 (false)
otherwise.
The A argument can be a structure or cell
array. It also be a MATLAB object, as described in Object-Oriented Programming, as long as that object overloads the size function.
Examples
Test matrix A and one element of the matrix:
A = rand(5);
isscalar(A)
ans =
0
isscalar(A(3,2))
ans =
1See Also
isvector, isempty, isnumeric, islogical, ischar, isa, is*
 | isreal | | issorted |  |
Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
Get the Interactive Kit