RunMat
  • Pricing
RunMat
GitHub
GitHub
DownloadSign InTry in Browser
DesktopRuntimeServer
RunMat

Run math blazing fast

GitHubX (Twitter)LinkedIn

Company

  • About
  • Pricing
  • Contact

Explore

  • RunMat for academia
  • RunMat vs MATLAB Online
  • Benchmarks

Get product updates and release notes from the RunMat team.

© 2026 Dystr · Made withfor the scientific community.

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.

LicensePrivacy
/
See all docs
Builtin Reference
    • damp
    • db
    • dcgain
    • feedback
    • impulse
    • isstable
    • lqr
    • nyquist
    • pole
    • pzmap
    • rlocus
    • ss
    • step
    • stepinfo
    • tf
    • zero

feedback — Form SISO feedback interconnections for transfer-function models.

feedback(sys1, sys2) returns the closed-loop SISO transfer function for negative feedback. The current public MathWorks documentation covers dynamic-system inputs, an optional sign, feed-index forms, and signal-name forms. RunMat currently implements the SISO tf subset with an ordinary double scalar feedback gain; broader scalar, native-single, typed-integer, logical, and resident forms are explicit RunMat extensions.

Syntax

sys = feedback(sys1)
sys = feedback(sys1, sys2)
sys = feedback(sys1, sys2, sign)

Inputs

NameTypeRequiredDefaultDescription
sys1AnyYes—Forward-path SISO transfer-function model.
sys2AnyNo1Feedback-path SISO transfer function or scalar gain.
signNumericScalarNo-1-1 for negative feedback or +1 for positive feedback.

Returns

NameTypeDescription
sysAnyClosed-loop SISO transfer-function object.

Errors

IdentifierWhenMessage
RunMat:feedback:InvalidArgumentInputs do not match supported feedback invocation forms.feedback: invalid argument
RunMat:feedback:InvalidModelInput systems are not supported SISO transfer-function models.feedback: invalid model
RunMat:feedback:InvalidSignFeedback sign is not -1 or +1.feedback: sign must be -1 or +1
RunMat:feedback:UnsupportedModelA supported-looking model uses unsupported delays or incompatible sample times.feedback: unsupported model
RunMat:feedback:InternalClosed-loop transfer-function assembly failed.feedback: internal error

How feedback works

  • Supports real or complex SISO tf objects represented by numerator and denominator coefficient vectors.
  • feedback(sys1) uses unity negative feedback as a gated RunMat-only convenience form.
  • feedback(sys1, sys2) computes sys1/(1 + sys1*sys2).
  • feedback(sys1, sys2, +1) computes positive feedback as sys1/(1 - sys1*sys2).
  • An ordinary double scalar sys2 is promoted to a constant transfer function using sys1's variable and sample time; scalar sys1 and scalar/scalar systems are independently gated RunMat extensions.
  • Typed-integer gains and typed-integer signs accept all eight integer classes only in RunMat extension mode. Gains cross once into the floating/complex coefficient domain, so wide int64 and uint64 values can round; signs retain the exact valid set -1 or +1.
  • Native-single, logical, and resident numeric inputs have separate RunMat-only gates. Resident inputs gather for host assembly, and the result remains a host tf object.
  • Input systems must have compatible sample times.
  • Nonzero input or output delays are rejected with a clear unsupported-model diagnostic.

GPU memory and residency

feedback returns a host-side tf object. Resident numeric gains and signs are a gated RunMat extension, gather before host model assembly, and do not preserve gpuArray residency.

Examples

Unity negative feedback

s = tf('s');
G = 2/(s + 3);
T = feedback(G, 1);
T.Denominator

Expected output:

ans = [1 5]

Positive feedback

G = tf(2, [1 3]);
T = feedback(G, 1, +1);
T.Denominator

Expected output:

ans = [1 1]

How RunMat validates feedback

feedback validates argument count, extension admission before resident gather or model dispatch, feedback sign, sample-time compatibility, zero-delay support, and transfer-function model shape. Source-local tests cover negative and positive feedback, all eight integer classes, wide-integer floating conversion, logical admission, stable extension identifiers, and resident rejection before provider access; VM workflows cover tf('s').

  • Implementation: `crates/runmat-runtime/src/builtins/control/feedback.rs`

See Correctness & Trust for the full methodology and coverage table.

Using feedback with coding agents

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

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

FAQ

Does feedback support MIMO systems?⌄

Not yet. This implementation supports SISO transfer-function objects and scalar gains.

Does it support state-space models?⌄

Not yet. The current model-family support is SISO tf.

Which documented feedback forms are still missing?⌄

The current public MATLAB documentation includes feedin/feedout topology selection and signal-name selection. Those forms require general MIMO and named-I/O infrastructure that RunMat does not yet provide.

Are typed integer gains MATLAB-compatible?⌄

Current public documentation does not establish typed-integer gains or signs. RunMat supports all eight classes as explicit extensions: gains enter floating coefficient arithmetic, while the sign must still be exactly -1 or +1.

Related Control functions

damp · db · dcgain · impulse · isstable · lqr · nyquist · pole · pzmap · rlocus · ss · step · stepinfo · tf · zero

Open-source implementation

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

  • View the source for feedback in Rust on GitHub
  • Learn how the RunMat runtime works
  • Found a bug? Open an issue with a minimal reproduction.

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.

Download RunMatOpen Sandbox
On this page
  • Syntax
  • Inputs
  • Returns
  • Errors
  • How feedback works
  • GPU memory and residency
  • Examples
  • Unity negative feedback
  • Positive feedback
  • How RunMat validates feedback
  • Using feedback with coding agents
  • FAQ
  • Related Control functions
  • Open-source implementation
  • About RunMat