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

feedback — Interconnect SISO transfer functions in a feedback loop.

feedback(sys1,sys2) constructs the negative-feedback closed-loop transfer function sys1/(1+sys1*sys2). An optional sign of +1 selects positive feedback, giving sys1/(1-sys1*sys2). Current RunMat support is SISO tf models with compatible sample times and no nonzero delays.

Syntax

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

Inputs

sys1
Type
Any
Required
Yes
Description
Forward-path SISO tf object or RunMat scalar gain.
sys2
Type
Any
Required
No
Default
1
Description
Feedback-path SISO tf object or scalar gain.
sign
Type
NumericScalar
Required
No
Default
-1
Description
-1 for negative or +1 for positive feedback.
NameTypeRequiredDefaultDescription
sys1AnyYes—Forward-path SISO tf object or RunMat scalar gain.
sys2AnyNo1Feedback-path SISO tf object or scalar gain.
signNumericScalarNo-1-1 for negative or +1 for positive feedback.

Returns

sys
Type
Any
Description
Closed-loop SISO tf object.
NameTypeDescription
sysAnyClosed-loop SISO tf object.

Errors

RunMat:feedback:InvalidArgument
When
Inputs do not match supported invocation forms.
Message
feedback: invalid argument
RunMat:feedback:InvalidModel
When
Inputs are not supported SISO transfer-function models or scalar gains.
Message
feedback: invalid model
RunMat:feedback:InvalidSign
When
Feedback sign is not -1 or +1.
Message
feedback: sign must be -1 or +1
IdentifierWhenMessage
RunMat:feedback:InvalidArgumentInputs do not match supported invocation forms.feedback: invalid argument
RunMat:feedback:InvalidModelInputs are not supported SISO transfer-function models or scalar gains.feedback: invalid model
RunMat:feedback:InvalidSignFeedback sign is not -1 or +1.feedback: sign must be -1 or +1
RunMat:feedback:InvalidSampleTimeA transfer-function model has an invalid sample time or variable domain.feedback: invalid sample time
RunMat:feedback:InvalidVariableA transfer-function model has an invalid variable for its sample time.feedback: invalid variable
RunMat:feedback:UnsupportedModelModel has unsupported delays or incompatible sample times.feedback: unsupported model
RunMat:feedback:InternalClosed-loop assembly failed.feedback: internal error

Forms and compatibility

The MATLAB-compatible subset accepts a SISO tf object as sys1 and a compatible SISO tf object or ordinary real or complex double scalar gain as sys2; sign is -1 or +1. A scalar sys2 becomes a constant transfer function with sys1's variable and sample time. The one-argument unity-feedback form, scalar sys1, and scalar/scalar form have independent RunMat-only extension gates.

Typed-integer scalar gains and signs, native-single, logical, and resident numeric arguments have separate RunMat-only gates. All eight fixed-width integer classes are admitted as scalar gains or signs; gains cross into binary64 tf coefficients, so wide integers can round. A typed-integer sign must still be exactly -1 or +1. Typed-integer tf coefficients or Ts and logical tf coefficients assigned after construction retain their model-property gates; integer model properties require exact conversion, unlike scalar gains.

Both tf models must have compatible sample times. Nonzero input or output delays are not yet supported. MIMO, state-space, feed-index and signal-name topology forms remain outside the current implementation.

Execution and placement

The operation runs on the host and produces a new host tf object; it has no provider-level GPU kernel and is a fusion boundary. Valid resident scalar gains and signs gather after extension admission. Required resident coefficient properties inside valid tf objects gather through their owner during ordered model parsing; unrelated object properties are not read.

The call can suspend for provider gathers and can throw for unsupported model forms, invalid sign, or failed interconnection. It does not mutate input models or use ambient filesystem, network, UI, randomness, or time services.

Examples

Unity negative feedback

G = tf(2, [1 3]); T = feedback(G, 1); d = T.Denominator; fprintf('d = [%g %g]\n', d(1), d(2));

Expected output:

d = [1 5]

Positive feedback

G = tf(2, [1 3]); T = feedback(G, 1, +1); d = T.Denominator; fprintf('d = [%g %g]\n', d(1), d(2));

Expected output:

d = [1 1]

RunMat unity-feedback shorthand

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

RunMat integer scalar gain

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

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 or state-space systems?⌄

Not yet. The current implementation constructs SISO tf interconnections.

Are typed-integer gains MATLAB-compatible?⌄

Their documented parity is unverified. RunMat admits them only in RunMat compatibility mode; conversion to floating tf coefficients can round wide values.

Which topology forms are missing?⌄

Feed-index and signal-name forms require MIMO and named-I/O infrastructure that is not yet supported.

Related Control functions

Analysis

care · ctrb · damp · db · dcgain · dlqr · 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 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 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
  • Forms and compatibility
  • Execution and placement
  • Examples
  • Unity negative feedback
  • Positive feedback
  • RunMat unity-feedback shorthand
  • RunMat integer scalar gain
  • Using feedback with coding agents
  • FAQ
  • Related Control functions
  • Analysis
  • Response
  • Models
  • Control
  • Source you can read
  • About RunMat