RunMat
  • Pricing
RunMat
GitHub
GitHub
Sign inTry in browser
DesktopRuntimePhysicsCADAdministrationAgent

Get RunMat updates

New releases, guides and examples.

Product+
  • Runtime
  • GPU
  • Parallel
  • Compile
  • Interop and MEX
  • Simulation
  • MCAD
  • ECAD
  • Enterprise
  • AI integrations
  • Pricing
  • Download
Math+
  • Signal processing
  • Linear algebra
  • Statistics
  • Curve fitting
  • Differential equations
  • Control systems
  • Optimization
  • Finance
  • Data and tables
  • Plotting
Physics+
  • Simulation overview
  • Structural
  • Thermal
  • Electromagnetic
  • Joule heating
  • Thermal stress
  • Acoustics
  • Fluid flow
  • Conjugate heat transfer
  • Fluid–structure
  • What is FEA
Industries+
  • Aerospace
  • Automotive and transportation
  • Defense
  • Electronics and semiconductors
  • Energy
  • Industrial machinery
  • Life sciences
  • Quantitative finance
Learn+
  • Guides
  • Docs
  • Function reference
  • Language reference
  • Migration guide
  • Changelog
  • MATLAB Online
  • MATLAB AI agent
  • For students
Compare+
  • RunMat vs MATLAB
  • RunMat vs Ansys
  • RunMat vs SOLIDWORKS
  • RunMat vs Altium
  • RunMat vs Cadence
  • RunMat vs COMSOL
  • RunMat vs Python
  • RunMat vs Julia
  • RunMat vs Physics AI
  • RunMat vs Octave
  • Benchmarks
  • MATLAB alternatives
  • All comparisons
Company+
  • About
  • Blog
  • Contact
  • Source code↗
  • License
  • Privacy
  • Terms

Product

  • Runtime
  • GPU
  • Parallel
  • Compile
  • Interop and MEX
  • Simulation
  • MCAD
  • ECAD
  • Enterprise
  • AI integrations
  • Pricing
  • Download

Math

  • Signal processing
  • Linear algebra
  • Statistics
  • Curve fitting
  • Differential equations
  • Control systems
  • Optimization
  • Finance
  • Data and tables
  • Plotting

Physics

  • Simulation overview
  • Structural
  • Thermal
  • Electromagnetic
  • Joule heating
  • Thermal stress
  • Acoustics
  • Fluid flow
  • Conjugate heat transfer
  • Fluid–structure
  • What is FEA

Industries

  • Aerospace
  • Automotive and transportation
  • Defense
  • Electronics and semiconductors
  • Energy
  • Industrial machinery
  • Life sciences
  • Quantitative finance

Learn

  • Guides
  • Docs
  • Function reference
  • Language reference
  • Migration guide
  • Changelog
  • MATLAB Online
  • MATLAB AI agent
  • For students

Compare

  • RunMat vs MATLAB
  • RunMat vs Ansys
  • RunMat vs SOLIDWORKS
  • RunMat vs Altium
  • RunMat vs Cadence
  • RunMat vs COMSOL
  • RunMat vs Python
  • RunMat vs Julia
  • RunMat vs Physics AI
  • RunMat vs Octave
  • Benchmarks
  • MATLAB alternatives
  • All comparisons

Company

  • About
  • Blog
  • Contact
  • Source code↗
  • License
  • Privacy
  • Terms
GitHubXLinkedIn

© Dystr, Inc. · RunMat v0.7.1, Nov 17, 2026

RunMat® is a registered trademark of Dystr, Inc. MATLAB® is a registered trademark of The MathWorks, Inc. RunMat is not affiliated with, endorsed by, or sponsored by The MathWorks, Inc.

/
See all docs
Builtin Reference
    • addlistener
    • addParameter
    • addprop
    • assignin
    • builtin
    • cancel
    • class
    • clear
    • clearAllMemoizedCaches
    • clearCache
    • clearvars
    • dbclear
    • dbstack
    • dbstatus
    • dbtype
    • eval
    • evalc
    • evalin
    • feval
    • findprop
    • func2str
    • functions
    • get.p
    • getcallinfo
    • getmethod
    • inputname
    • inputParser
    • isa
    • ischar
    • isdeployed
    • iskeyword
    • ismethod
    • isobject
    • isstring
    • isUnderlyingType
    • isvalid
    • keyboard
    • loadobj
    • localfunctions
    • matlab.metadata.DynamicProperty.delete
    • memoize
    • metaclass
    • mfilename
    • mislocked
    • mlock
    • munlock
    • namelengthmax
    • narginchk
    • nargoutchk
    • new_object
    • notify
    • numArgumentsFromSubscript
    • onCleanup
    • parse
    • saveobj
    • set.p
    • stats
    • str2func
    • subsasgn
    • subsref
    • superclasses
    • underlyingType
    • verLessThan
    • version
    • which
    • who
    • whos

getmethod — Create a method-bound function handle from an object or class reference.

getmethod(receiver, name) is a RunMat-only extension that creates a callable method handle. Object and handle-object receivers are captured for later instance dispatch. Class references select static method bindings when available, or retain a qualified named-function route. Creating a handle does not execute the method.

Syntax

fh = getmethod(obj_or_class, name)

Inputs

obj_or_class
Type
Any
Required
Yes
Default
—
Description
Object receiver or class reference.
name
Type
StringScalar
Required
Yes
Default
—
Description
Method name.
NameTypeRequiredDefaultDescription
obj_or_classAnyYes—Object receiver or class reference.
nameStringScalarYes—Method name.

Returns

fh
Type
Any
Description
Bound method closure/handle.
NameTypeDescription
fhAnyBound method closure/handle.

Errors

RunMat:GetMethodNameInvalid
When
Method name is empty.
Message
getmethod: method name must not be empty
RunMat:GetMethodReceiverUnsupported
When
Receiver is neither object nor class reference.
Message
getmethod: unsupported receiver
RunMat:MethodPrivate
When
Resolved method exists but is inaccessible from the current class scope.
Message
getmethod: method is not accessible from current scope
IdentifierWhenMessage
RunMat:GetMethodNameInvalidMethod name is empty.getmethod: method name must not be empty
RunMat:GetMethodReceiverUnsupportedReceiver is neither object nor class reference.getmethod: unsupported receiver
RunMat:MethodPrivateResolved method exists but is inaccessible from the current class scope.getmethod: method is not accessible from current scope
RunMat:GetMethod:ArityInput count differs from two.getmethod: expected receiver and method name
RunMat:TooManyOutputsMore than one output is requested.getmethod: at most one output is supported

Inputs, output and compatibility

receiver must be a host object, handle object, or class reference. name must be scalar string text or a character row; surrounding whitespace is trimmed and the remaining name must be nonempty. Numeric and integer receivers or names reject without conversion, provider access, or gather.

Zero or one output is supported. The output is a function handle; its eventual parameter/output facts, capabilities and resolved callable identity remain runtime-dependent. The getmethod-bound-method-handle extension is rejected when RunMat extensions are disabled, with RunMat:compatibility:GetmethodExtension.

Binding and access

The current class scope controls private and protected access. An inaccessible existing method rejects with RunMat:MethodPrivate. Public methods are accessible; protected access requires a compatible caller class or subclass.

A known instance method preserves its registered semantic binding and captures the receiver. For an unknown instance member, the closure captures the receiver, trimmed method name and caller scope for the existing bound-method dispatcher; successful handle creation does not prove that later dispatch will succeed.

A class reference with a registered static method binding returns a closure without receiver captures. Other class-reference requests use the existing qualified str2func route. A handle object capture refers to the same handle; a value-object capture follows existing value semantics.

Execution and resource limits

The contextual binding retains its original BuiltinArguments throughout construction and scopes the selected RuntimeContext over registry lookup, access checks and closure creation. No alternate registry or executor is introduced.

Cancellation and revoked allocation authority are checked before cloning controls, context-scope allocation or creating captures. Closure metadata and capture backing have no exact finite-resource bound; managed invocations refuse with RunMat:Placement:InsufficientResourceEvidence rather than escaping the budget.

Construction is native/WASM host-only and outside numeric fusion. No accelerator provider, distributed execution or implicit gather is available. Invoking the returned handle is a separate operation whose actual target may suspend, throw or perform arbitrary user effects.

Examples

Create a deferred bound method handle

obj = new_object('ExampleReceiver');
f = getmethod(obj, 'compute');

Reject a numeric receiver

f = getmethod(1, 'compute');

Using getmethod with coding agents

Open a RunMat example with live inputs, then ask the agent to explain how getmethod changes the result.

Run a small getmethod example, explain the result, then change one input and compare the output.

FAQ

Does a handle prove that the method exists?⌄

No. Unknown instance methods retain deferred bound dispatch, so the error may arise when the handle is called.

Does getmethod run the method?⌄

No. It constructs a handle; invoke that handle separately to run the method.

Related Introspection functions

addlistener · addParameter · addprop · assignin · builtin · cancel · class · clear · clearAllMemoizedCaches · clearCache · clearvars · dbclear · dbstack · dbstatus · dbtype · eval · evalc · evalin · feval · findprop · func2str · functions · get.p · getcallinfo · inputname · inputParser · isa · ischar · isdeployed · iskeyword · ismethod · isobject · isstring · isUnderlyingType · isvalid · keyboard · loadobj · localfunctions · matlab.metadata.DynamicProperty.delete · memoize · metaclass · mfilename · mislocked · mlock · munlock · namelengthmax · narginchk · nargoutchk · new_object · notify · numArgumentsFromSubscript · onCleanup · parse · saveobj · set.p · stats · str2func · subsasgn · subsref · superclasses · underlyingType · verLessThan · version · which · who · whos

Source you can read

Every RunMat function's source is public. Read exactly how getmethod is executed, line by line, in Rust.

  • View the source for getmethod in Rust on GitHub
  • Learn how the RunMat runtime works
  • Found a bug? Open an issue with a minimal reproduction.

About RunMat

RunMat is a runtime that executes MATLAB-syntax code fast on any GPU. The runtime is free for individuals, including freelancers; students and faculty at an academic institution, for teaching or research there; contributors to an open-source project, for work on that project; organizations with 250 or fewer people and US$10M or less in annual revenue; and anyone, for non-production use. See runmat.com/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.

Download RunMatOpen Sandbox
On this page
  • Syntax
  • Inputs
  • Returns
  • Errors
  • Inputs, output and compatibility
  • Binding and access
  • Execution and resource limits
  • Examples
  • Create a deferred bound method handle
  • Reject a numeric receiver
  • Using getmethod with coding agents
  • FAQ
  • Related Introspection functions
  • Source you can read
  • About RunMat