RunMat
  • Pricing
RunMat
GitHub
GitHub
Sign inTry in browser
DesktopRuntimePhysicsCADAdministrationAgent

Get RunMat updates

New releases, guides and examples.

Product+
  • Runtime
  • GPU
  • Parallel
  • Compile
  • Interop and MEX
  • Simulation
  • MCAD
  • ECAD
  • Enterprise
  • AI integrations
  • Pricing
  • Download
Math+
  • Signal processing
  • Linear algebra
  • Statistics
  • Curve fitting
  • Differential equations
  • Control systems
  • Optimization
  • Finance
  • Data and tables
  • Plotting
Physics+
  • Simulation overview
  • Structural
  • Thermal
  • Electromagnetic
  • Joule heating
  • Thermal stress
  • Acoustics
  • Fluid flow
  • Conjugate heat transfer
  • Fluid–structure
  • What is FEA
Industries+
  • Aerospace
  • Automotive and transportation
  • Defense
  • Electronics and semiconductors
  • Energy
  • Industrial machinery
  • Life sciences
  • Quantitative finance
Learn+
  • Guides
  • Docs
  • Function reference
  • Language reference
  • Migration guide
  • Changelog
  • MATLAB Online
  • MATLAB AI agent
  • For students
Compare+
  • RunMat vs MATLAB
  • RunMat vs Ansys
  • RunMat vs SOLIDWORKS
  • RunMat vs Altium
  • RunMat vs Cadence
  • RunMat vs COMSOL
  • RunMat vs Python
  • RunMat vs Julia
  • RunMat vs Physics AI
  • RunMat vs Octave
  • Benchmarks
  • MATLAB alternatives
  • All comparisons
Company+
  • About
  • Blog
  • Contact
  • Source code↗
  • License
  • Privacy
  • Terms

Product

  • Runtime
  • GPU
  • Parallel
  • Compile
  • Interop and MEX
  • Simulation
  • MCAD
  • ECAD
  • Enterprise
  • AI integrations
  • Pricing
  • Download

Math

  • Signal processing
  • Linear algebra
  • Statistics
  • Curve fitting
  • Differential equations
  • Control systems
  • Optimization
  • Finance
  • Data and tables
  • Plotting

Physics

  • Simulation overview
  • Structural
  • Thermal
  • Electromagnetic
  • Joule heating
  • Thermal stress
  • Acoustics
  • Fluid flow
  • Conjugate heat transfer
  • Fluid–structure
  • What is FEA

Industries

  • Aerospace
  • Automotive and transportation
  • Defense
  • Electronics and semiconductors
  • Energy
  • Industrial machinery
  • Life sciences
  • Quantitative finance

Learn

  • Guides
  • Docs
  • Function reference
  • Language reference
  • Migration guide
  • Changelog
  • MATLAB Online
  • MATLAB AI agent
  • For students

Compare

  • RunMat vs MATLAB
  • RunMat vs Ansys
  • RunMat vs SOLIDWORKS
  • RunMat vs Altium
  • RunMat vs Cadence
  • RunMat vs COMSOL
  • RunMat vs Python
  • RunMat vs Julia
  • RunMat vs Physics AI
  • RunMat vs Octave
  • Benchmarks
  • MATLAB alternatives
  • All comparisons

Company

  • About
  • Blog
  • Contact
  • Source code↗
  • License
  • Privacy
  • Terms
GitHubXLinkedIn

© Dystr, Inc. · RunMat v0.7.1, Nov 17, 2026

RunMat® is a registered trademark of Dystr, Inc. MATLAB® is a registered trademark of The MathWorks, Inc. RunMat is not affiliated with, endorsed by, or sponsored by The MathWorks, Inc.

/
See all docs
Builtin Reference
    • care
    • ctrb
    • damp
    • db
    • dcgain
    • dlqr
    • feedback
    • isstable
    • lqr
    • minreal
    • pade
    • pole
    • pzmap
    • rlocus
    • stepinfo
    • zero

db — Convert voltage magnitude or power to decibels.

db(y) and db(y, 'voltage') compute 20*log10(abs(y)). db(y, 'power') computes 10*log10(y) for nonnegative real power. db(y, R) computes 10*log10(abs(y).^2 ./ R) for finite positive real resistance. The resistance form uses implicit expansion.

Syntax

yDb = db(y)
yDb = db(y, "voltage")
yDb = db(y, "power")
yDb = db(y, R)

Inputs

y
Type
Any
Required
Yes
Description
Input signal magnitude or power quantity.
modeOrR
Type
Any
Required
No
Default
"voltage"
Description
Mode string ('voltage' or 'power') or positive real resistance reference.
NameTypeRequiredDefaultDescription
yAnyYes—Input signal magnitude or power quantity.
modeOrRAnyNo"voltage"Mode string ('voltage' or 'power') or positive real resistance reference.

Returns

yDb
Type
NumericArray
Description
Real single or double decibel output, following the input or broadcast shape.
NameTypeDescription
yDbNumericArrayReal single or double decibel output, following the input or broadcast shape.

Errors

RunMat:db:InvalidArgument
When
Inputs do not match supported db invocation forms.
Message
db: invalid argument
RunMat:db:InvalidMode
When
Mode string is not recognized or is not a scalar text value.
Message
db: invalid mode
RunMat:db:InvalidInput
When
Input signal cannot be interpreted as numeric magnitude data.
Message
db: invalid input
IdentifierWhenMessage
RunMat:db:InvalidArgumentInputs do not match supported db invocation forms.db: invalid argument
RunMat:db:InvalidModeMode string is not recognized or is not a scalar text value.db: invalid mode
RunMat:db:InvalidInputInput signal cannot be interpreted as numeric magnitude data.db: invalid input
RunMat:db:InvalidResistanceResistance reference is non-numeric, complex, non-finite, or non-positive.db: invalid resistance
RunMat:db:SizeMismatchSignal and resistance inputs are not broadcast compatible.db: array sizes are not compatible for broadcasting
RunMat:db:InternalInternal tensor conversion or allocation failed.db: internal error

Modes and values

Voltage mode accepts real or complex numeric signal data and uses magnitude. Power mode accepts only real, nonnegative signal values; negative or complex values raise an error. Resistance must be finite, positive, and real, and may be an array broadcast-compatible with the signal. Zero signal values produce negative infinity.

The result is real single if the signal or resistance has native single precision, and real double otherwise. Unary and text-mode results follow the signal shape; resistance-mode results have the broadcast shape. Integer, logical, complex-integer signals and typed-integer resistance are RunMat extensions gated by compat = 'runmat'; they are rejected in MATLAB compatibility mode.

Execution and placement

Decibel conversion executes on the host and is a fusion boundary. Resident input arrays are gathered from their owning provider before conversion. There is no GPU kernel for db; the result is host-resident.

The operation may suspend during a provider gather and may throw for invalid mode, signal, resistance, or incompatible array sizes. It has no workspace, filesystem, network, callback, user-interface, randomness, or time effect.

Examples

Voltage decibels

y = db(10); fprintf('%.0f\n', y);

Expected output:

20

Power decibels

p = db(100, 'power'); fprintf('%.0f\n', p);

Expected output:

20

Voltage across reference resistance

p = db(10, 50); fprintf('%.4f\n', p);

Expected output:

3.0103

Complex signal magnitude

z = db(3 + 4i); fprintf('%.4f\n', z);

Expected output:

13.9794

Preserve single precision

y = db(single([1 10]));

RunMat integer signal extension

y = db(uint16([1 10]));

Using db with coding agents

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

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

FAQ

What is the default mode?⌄

Voltage mode, equivalent to db(y, 'voltage').

How are complex inputs handled?⌄

Voltage and resistance modes use the complex magnitude and return real values. Power mode rejects complex input.

What happens for zero input?⌄

The logarithm yields negative infinity.

Can resistance be an array?⌄

Yes. It must be real, finite, positive, and broadcast-compatible with the signal.

Related Control functions

Analysis

care · ctrb · damp · dcgain · dlqr · feedback · isstable · lqr · minreal · pade · pole · pzmap · rlocus · stepinfo · zero

Response

bode · evalfr · freqresp · impulse · nyquist · step

Models

series · ss2tf · tfdata

Control

ss · tf · tf.ldivide · tf.minus · tf.mldivide · tf.mpower · tf.mrdivide · tf.mtimes · tf.plus · tf.power · tf.rdivide · tf.times · tf.uminus · tf.uplus

Source you can read

Every RunMat function's source is public. Read exactly how db is executed, line by line, in Rust.

  • View the source for db 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.

Getting started · Benchmarks · Pricing

Download RunMat

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

Download RunMatOpen Sandbox
On this page
  • Syntax
  • Inputs
  • Returns
  • Errors
  • Modes and values
  • Execution and placement
  • Examples
  • Voltage decibels
  • Power decibels
  • Voltage across reference resistance
  • Complex signal magnitude
  • Preserve single precision
  • RunMat integer signal extension
  • Using db with coding agents
  • FAQ
  • Related Control functions
  • Analysis
  • Response
  • Models
  • Control
  • Source you can read
  • About RunMat