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

NameTypeRequiredDefaultDescription
AAnyYesValue to validate.

Returns

NameTypeDescription
CAnyCell row vector of alternating field names and values.

Errors

IdentifierWhenMessage
RunMat:validators:ValidationFailedA value does not satisfy the requested validator.argument validation failed
RunMat:validators:InvalidArgumentA 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.

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.

Getting started · Benchmarks · Pricing

Download RunMat

Download RunMat for full performance, or use RunMat in your browser for zero setup.