findprop — Find property metadata on an object or handle object.
prop = findprop(obj, name) returns property metadata for class-defined or dynamic properties. Dynamic properties on handle objects return a matlab.metadata.DynamicProperty handle; class-defined properties return a matlab.metadata.Property object. Missing properties return an empty double.
Syntax
prop = findprop(object, property_name)Inputs
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
object | Any | Yes | — | Object or handle object to inspect. |
property_name | PropertyName | Yes | — | Property name to locate. |
Returns
| Name | Type | Description |
|---|---|---|
prop | Any | Property metadata object, or an empty double when no property exists. |
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 findprop works
- The target must be an object or valid handle object.
- Dynamic property lookup on handle objects returns a metadata handle that can later be passed to
delete. - Class-defined property lookup returns metadata fields including
Name,DefiningClass,GetAccess,SetAccess, andDependent. - Missing properties return
[]. - Invalid handle targets raise
RunMat:dynamicprops:InvalidTarget.
GPU memory and residency
findprop inspects host-side metadata and returns host metadata values.
Examples
Find a dynamic property
p = addprop(s, 'gain');
q = findprop(s, 'gain');
name = q.NameExpected output:
name = 'gain'Missing property
q = findprop(s, 'missing')Expected output:
q = []Using findprop with coding agents
Open a RunMat example with live inputs, then ask the agent to explain how findprop changes the result.
Run a small findprop example, explain the result, then change one input and compare the output.
FAQ
Can metadata returned by findprop for class-defined properties be deleted?⌄
No. Only dynamic property metadata handles returned for per-instance properties can be deleted.
Does findprop invoke user methods?⌄
No. It inspects runtime class and object metadata only.
Related Introspection functions
addprop · class · clear · clearAllMemoizedCaches · clearCache · clearvars · dbclear · dbstack · dbstatus · dbtype · evalc · getcallinfo · inputParser · isa · ischar · isdeployed · iskeyword · ismethod · isobject · isstring · isUnderlyingType · keyboard · matlab.metadata.DynamicProperty.delete · 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 findprop is executed, line by line, in Rust.
- View the source for findprop 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.