matlab.metadata.DynamicProperty.delete — Remove a dynamic property through its metadata handle.
delete(prop) removes the per-instance dynamic property represented by a matlab.metadata.DynamicProperty handle and invalidates that metadata handle.
Syntax
delete(prop)Inputs
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
prop | Any | Yes | — | Dynamic property metadata handle to delete. |
Errors
| Identifier | When | Message |
|---|---|---|
RunMat:dynamicprops:InvalidTarget | The target is not a valid handle object. | dynamicprops: target must be a valid handle object |
RunMat:dynamicprops:InvalidName | The property name is empty or not a valid identifier. | dynamicprops: invalid property name |
RunMat:dynamicprops:DuplicateProperty | A class-defined or dynamic property already exists with the requested name. | dynamicprops: property already exists |
RunMat:dynamicprops:InvalidMetadata | A dynamic property metadata handle is invalid or malformed. | dynamicprops: invalid dynamic property metadata |
RunMat:dynamicprops:UnsupportedMetadataProperty | A metadata property assignment uses an unsupported property name or value. | dynamicprops: unsupported dynamic property metadata assignment |
How matlab.metadata.DynamicProperty.delete works
- The input must be a valid
matlab.metadata.DynamicPropertyhandle returned byaddproporfindprop. - Deleting the metadata handle removes the target object's dynamic property value and metadata.
- All metadata handle aliases for the same dynamic property observe the deleted state because RunMat reuses a canonical metadata object for
findpropaliases. - After deletion, reading or writing the removed dynamic property through dot syntax,
getfield, orsetfieldfails like an undefined property.
GPU memory and residency
matlab.metadata.DynamicProperty.delete mutates host-side object metadata. GPU-resident values previously stored in the removed property are released through ordinary object-property ownership.
Example
Remove a dynamic property
classdef Sensor < dynamicprops
end
s = new_object('Sensor');
p = addprop(s, 'gain');
s.gain = 7;
delete(p);Expected output:
The dynamic property `gain` is removed from `s`.Using matlab.metadata.DynamicProperty.delete with coding agents
Open a RunMat example with live inputs, then ask the agent to explain how matlab.metadata.DynamicProperty.delete changes the result.
Run a small matlab.metadata.DynamicProperty.delete example, explain the result, then change one input and compare the output.
FAQ
Is this the same as filesystem delete?⌄
No. This qualified method is the dynamic-property metadata method invoked when delete receives a matlab.metadata.DynamicProperty handle. Filesystem deletion is documented by the general delete builtin.
Does deleting the metadata handle delete the owner object?⌄
No. It removes only the dynamic property from the owner object and invalidates the metadata handle.
Related Introspection functions
addprop · class · clear · clearAllMemoizedCaches · clearCache · clearvars · dbclear · dbstack · dbstatus · dbtype · evalc · findprop · getcallinfo · inputParser · isa · ischar · isdeployed · iskeyword · ismethod · isobject · isstring · isUnderlyingType · keyboard · memoize · metaclass · mislocked · mlock · munlock · namelengthmax · onCleanup · stats · superclasses · underlyingType · verLessThan · version · which · who · whos
Open-source implementation
Unlike proprietary runtimes, every RunMat function is open-source. Read exactly how matlab.metadata.DynamicProperty.delete is executed, line by line, in Rust.
- View the source for matlab.metadata.DynamicProperty.delete in Rust on GitHub
- Learn how the RunMat runtime works
- Found a bug? Open an issue with a minimal reproduction.
About RunMat
RunMat is an open-source runtime that executes MATLAB-syntax code blazing on any GPU. It is licensed under the Apache 2.0 license.
- RunMat automatically optimizes your math for GPU execution on Apple, Nvidia, and AMD hardware. No code changes needed. Simulations that took hours now take minutes.
- Start running code in seconds. RunMat runs in the browser, on the desktop, or from the CLI. No license server, no IT ticket.