Skip to content

metafunction

miscellaneous · scripts/miscellaneous/metafunction.m

: obj = metafunction (identifier)
: obj = metafunction (identifier, "Arguments", vals)
: obj = metafunction (identifier, "ArgumentTypes", types)

Create metadata describing a function or method (MATLAB R2026a).

Returns a matlab.metadata.Function for function names, or matlab.metadata.Method for Class/method identifiers.

Decision (MATLAB R2026a, verified on this host):

  • Non-text first argument errors with MATLAB:function_metadata:IdentifierOrNameNotScalarText.
  • Unknown names raise a not-found error (message 'name' not found.).
  • Built-ins report FullPath as "built-in" and a CallSignature whose inputs/outputs are repeating varargin/varargout when argument blocks are absent.
  • Arguments/ArgumentTypes are accepted for API parity; overload resolution beyond which is best-effort.