empty
Create empty array of specified class
Description
This page describes the empty
method, which creates empty
arrays of a given class. To test if an existing array is an empty array, use isempty
.
returns an empty 0-by-0 array of the class named by A
= ClassName.emptyClassName
. Replace ClassName
with the actual name of the class.
returns an empty array with the specified dimensions. At least one of the dimensions must be 0.A
= ClassName.empty(sz1,...,szN
)
returns an empty array with the specified dimensions. At least one of the dimensions must be 0. Use this syntax to define an empty array that is the same size as an existing empty array. Pass the values returned by the A
= ClassName.empty(sizeVector
)size
function as inputs.
Examples
Input Arguments
Output Arguments
More About
Tips
empty
is a hidden, public, static method of all nonabstract MATLAB® classes. You can override theempty
method in class definitions.This method is useful for creating empty arrays of data types that do not have a special syntax for creating empty arrays, such as
[]
for double arrays.
Version History
Introduced in R2008a