metaclass — Return metadata for the runtime class of a value.
metaclass(object) returns RunMat's metadata reference for the runtime class of object. RunMat represents MATLAB matlab.metadata.Class values as ClassRef metadata tokens, the same representation produced by the ?ClassName parser path.
Syntax
mc = metaclass(object)Inputs
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
object | Any | Yes | — | Object or value whose runtime class metadata is requested. |
Returns
| Name | Type | Description |
|---|---|---|
mc | Any | Meta-class reference for the input value's runtime class. |
How metaclass works
- Object and handle-object inputs return a metadata reference for their registered runtime class.
- Text inputs describe the runtime text class. A row character vector returns metadata for
char; a string scalar or string array returns metadata forstring. - Class references are ordinary metadata objects to
metaclassand return metadata formeta.class. - gpuArray inputs return metadata for
gpuArraywithout gathering provider buffers. - Numeric, logical, cell, struct, function-handle, listener, and MException values return metadata for their RunMat runtime class.
- RunMat does not yet materialize full MATLAB
matlab.metadata.Classobject properties such asPropertyList,MethodList, orSuperclassList; those remain part of the broader metadata-object work.
Examples
Get metadata for an object
obj = Point();
mc = metaclass(obj)Expected output:
mc = <class Point>Text inputs describe text classes
mc = metaclass('Point')Expected output:
mc = <class char>Use the question-mark operator for class-name metadata
mc = ?PointExpected output:
mc = <class Point>Using metaclass with coding agents
Open a RunMat example with live inputs, then ask the agent to explain how metaclass changes the result.
Run a small metaclass example, explain the result, then change one input and compare the output.
FAQ
Does metaclass("Point") look up the Point class?⌄
No. This follows MATLAB semantics: text passed to metaclass is a text value, so RunMat returns metadata for string or char. Use ?Point or classref("Point") for class-name metadata.
Is the result a full MATLAB metadata object?⌄
Not yet. RunMat returns its existing ClassRef metadata token. Static member and method dispatch already use this token, but full metadata property enumeration is still tracked by the object/type-introspection umbrella.
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 · matlab.metadata.DynamicProperty.delete · memoize · 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 metaclass is executed, line by line, in Rust.
- View the source for metaclass 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.