Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

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

More About

collapse all

Tall Array Support

This function fully supports tall arrays. For more information, see Tall Arrays.

Introduced before R2006a

Was this topic helpful?