namedargs2cell — Convert a scalar name-value struct into an alternating name/value cell row.
namedargs2cell(S) preserves scalar struct field order and returns {name1, value1, name2, value2, ...} for name-value forwarding patterns.
Syntax
C = namedargs2cell(S)Inputs
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
A | Any | Yes | — | Value to validate. |
Returns
| Name | Type | Description |
|---|---|---|
C | Any | Cell row vector of alternating field names and values. |
Errors
| Identifier | When | Message |
|---|---|---|
RunMat:validators:ValidationFailed | A value does not satisfy the requested validator. | argument validation failed |
RunMat:validators:InvalidArgument | A validator receives an unsupported argument count or argument type. | invalid argument validation input |
How namedargs2cell works
- Returns a normal value and does not mutate inputs.
- Accepts MATLAB text/struct representations supported by RunMat.
Example
Basic use
namedargs2cell(x)Expected output:
Result depends on input value.Using namedargs2cell with coding agents
Open a RunMat example with live inputs, then ask the agent to explain how namedargs2cell changes the result.
Run a small namedargs2cell example, explain the result, then change one input and compare the output.
Related Argument Validation functions
isvarname · mustBeA · mustBeColumn · mustBeFile · mustBeFinite · mustBeFloat · mustBeFolder · mustBeGreaterThan · mustBeGreaterThanOrEqual · mustBeInRange · mustBeInteger · mustBeLessThan · mustBeLessThanOrEqual · mustBeMember · mustBeNegative · mustBeNonempty · mustBeNonmissing · mustBeNonNan · mustBeNonnegative · mustBeNonpositive · mustBeNonsparse · mustBeNonzero · mustBeNonzeroLengthText · mustBeNumeric · mustBeNumericOrLogical · mustBePositive · mustBeReal · mustBeScalarOrEmpty · mustBeSparse · mustBeText · mustBeTextScalar · mustBeUnderlyingType · mustBeValidVariableName · mustBeVector · validateFunctionSignaturesJSON
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.