Documentation

isempty

Determine whether array is empty

Syntax

TF = isempty(A)

Description

TF = isempty(A)returns logical 1 (true) ifAis an empty array and logical 0 (false) otherwise. An empty array has at least one dimension of size zero, for example, 0-by-0 or 0-by-5.

Examples

collapse all

Determine if a multidimensional array is empty or not.

A = rand(2,2,2); isempty(A)
ans =logical0
A(:,:,:) = []; isempty(A)
ans =logical1

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

See Also

Introduced before R2006a

Was this topic helpful?