set.p — Return a value object with its conventional p_backing field updated.
Return a value object with its conventional p_backing field updated.
Syntax
obj = set.p(obj, value)Inputs
obj- Type
Any- Required
- Yes
- Default
- —
- Description
- Object receiver.
value- Type
Any- Required
- Yes
- Default
- —
- Description
- Value to assign.
Returns
obj- Type
Any- Description
- Updated object receiver.
Errors
RunMat:set.p:TooManyOutputs- When
- More than one output is requested.
- Message
set.p: expected at most one output
RunMat:SetPReceiverInvalid- When
- Receiver is not an object value.
- Message
set.p: requires object receiver
Behavior
This method-only runtime compatibility handler supports value objects, not handle objects. It does not invoke user property accessors.
The backing value may be a nested integer, resident or foreign value. It is forwarded without conversion; get.p returns double zero if p_backing is absent. set.p returns the updated value object.
Execution and ownership
Class metadata or value-object backing fields are inspected on the host without provider access. Nested resident and foreign values are not materialized.
Native and interpreted execution use the same portable runtime implementation. Class registry changes invalidate hierarchy assumptions.
Direct distributed inputs are unsupported. Ordinary workers require transferable values, available class metadata and callable/service dependencies; resident and foreign members retain their owner and affinity requirements.
Shared runtime placement owns timing and transfer accounting; this identity adds no scheduler or hardware thresholds.
Documentation reconciliation
Legacy title, category, keywords, summary, description, behavior, examples, FAQs, links, source and test references are retained here or in typed declarations. Fusion flags and provider precisions are represented by the canonical placement contract; no feature is required. Display-only examples are explanatory; executable examples below carry value assertions.
Example
Value-object backing field
obj = decomposition(eye(2)); obj = feval('set.p',obj,uint64(17)); result = feval('get.p',obj);Using set.p with coding agents
Open a RunMat example with live inputs, then ask the agent to explain how set.p changes the result.
Run a small set.p example, explain the result, then change one input and compare the output.
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 · 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 · 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 set.p is executed, line by line, in Rust.
- View the source for set.p 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.