empty
Create empty array of specified class
Description
This page describes theempty
method, which creates empty arrays of a given class. To test if an existing array is an empty array, useisempty
.
返回一个n empty 0-by-0 array of the class named byA
= ClassName.emptyClassName
. ReplaceClassName
with the actual name of the class.
返回一个n empty array with the specified dimensions. At least one of the dimensions must be 0.A
= ClassName.empty(sz1,...,szN
)
返回一个n 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 theA
= 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.