RunMat
GitHub

sym — Create a scalar symbolic variable or constant.

sym creates scalar symbolic variables from identifier text and scalar symbolic constants from numeric input. Nonconstant symbolic values remain symbolic through supported arithmetic, trigonometric, and limit operations.

Syntax

S = sym(value)

Inputs

NameTypeRequiredDefaultDescription
valueAnyYesVariable name, numeric scalar, or existing symbolic scalar.
optionsAnyVariadicReserved symbolic options.

Returns

NameTypeDescription
SAnyScalar symbolic variable or constant.

Errors

IdentifierWhenMessage
RunMat:sym:ArgCountOptions beyond the scalar input are supplied.sym: unsupported options
RunMat:sym:InvalidTextText input is neither a valid identifier nor a numeric scalar literal.sym: invalid symbolic text
RunMat:sym:InvalidInputInput cannot be represented as a scalar symbolic value.sym: expected a scalar text, numeric, logical, or symbolic input

How sym works

  • Text that is a valid MATLAB identifier creates a symbolic variable with that name.
  • Finite numeric, integer, logical, and scalar numeric tensor inputs create scalar symbolic constants with class sym.
  • Text containing a finite numeric scalar creates that numeric symbolic constant.
  • Symbolic values are host-only and do not participate in GPU fusion or residency.

Examples

Create a symbolic variable

x = sym('x')

Create a symbolic numeric constant

a = sym(2)

Using sym with coding agents

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

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

FAQ

Does sym create symbolic arrays?

No. RunMat currently represents scalar symbolic expressions; array-valued symbolic containers are not materialized.

Symbolic

limit · syms

Elementwise

abs · angle · complex · conj · double · exp · expm1 · factorial · gamma · heaviside · hypot · imag · ldivide · log · log10 · log1p · log2 · minus · nextpow2 · plus · pow2 · power · rdivide · real · sign · single · sqrt · times

Trigonometry

acos · acosh · asin · asinh · atan · atan2 · atanh · cos · cosd · cosh · deg2rad · rad2deg · sin · sind · sinh · tan · tand · tanh

Reduction

all · any · cummax · cummin · cumprod · cumsum · cumtrapz · diff · gradient · max · mean · median · min · nnz · prod · std · sum · trapz · var

Rounding

ceil · fix · floor · mod · rem · round

Factor

chol · eig · lu · qr · svd

Solve

cond · det · inv · linsolve · norm · null · pinv · rank · rcond · rref

Fft

fft · fft2 · fftshift · ifft · ifft2 · ifftshift

Interpolation

interp1 · interp2 · pchip · ppval · spline

Ode

ode15s · ode23 · ode45

Open-source implementation

Unlike proprietary runtimes, every RunMat function is open-source. Read exactly how sym is executed, line by line, in Rust.

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.