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

NameTypeRequiredDefaultDescription
propAnyYesDynamic property metadata handle to delete.

Errors

IdentifierWhenMessage
RunMat:dynamicprops:InvalidTargetThe target is not a valid handle object.dynamicprops: target must be a valid handle object
RunMat:dynamicprops:InvalidNameThe property name is empty or not a valid identifier.dynamicprops: invalid property name
RunMat:dynamicprops:DuplicatePropertyA class-defined or dynamic property already exists with the requested name.dynamicprops: property already exists

How matlab.metadata.DynamicProperty.delete works

  • The input must be a valid matlab.metadata.DynamicProperty handle returned by addprop or findprop.
  • 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 findprop aliases.
  • After deletion, reading or writing the removed dynamic property through dot syntax, getfield, or setfield fails 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.

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.

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.

Getting started · Benchmarks · Pricing

Download RunMat

Download RunMat for full performance, or use RunMat in your browser for zero setup.