matlab.lang.HandlePlaceholder Class
Namespace: matlab.lang
Description
This class is a subclass of handle, and it defines no members other than
what it inherits from handle. You can use
matlab.lang.HandlePlaceholder when you need a basic handle class to test
code. You can also use an object of this class as a default value when defining a property
with the WeakHandle attribute.
The matlab.lang.HandlePlaceholder class is a handle class.
Creation
Two common use cases for matlab.lang.HandlePlaceholder are:
Property validation — Defining a property using the
WeakHandleattribute requires class validation. You can usehandleas the class validator, but you need a non-abstract default value.matlab.lang.HandlePlaceholderis a concrete handle class, so setting the default value of the property to an empty array ofHandlePlaceHoldersatisfies the validation statement.matlab.lang.WeakReferencedefault value — The no-argument constructor ofmatlab.lang.WeakReferencereturns an instance with itsHandleproperty set to a deletedmatlab.lang.HandlePlaceholderobject.
You can also call the matlab.lang.HandlePlaceholder class
constructor directly with no arguments.
Examples
Version History
Introduced in R2024b