RunMat
GitHub

impulse — Compute or plot impulse responses in MATLAB and RunMat.

impulse(sys) computes the impulse response of supported dynamic system models. With output arguments it returns numeric response data; without outputs it plots the response, consistent with MATLAB semantics.

Syntax

y = impulse(sys)
y = impulse(sys, tFinal)
y = impulse(sys, t)
[y,t] = impulse(sys)
[y,t] = impulse(sys, tFinal)
[y,t] = impulse(sys, t)

Inputs

NameTypeRequiredDefaultDescription
sysAnyYesSISO tf model.
timeAnyNoFinal time scalar or explicit time vector.

Returns

NameTypeDescription
yNumericArrayImpulse response samples (column vector).
tNumericArrayTime samples (column vector).

Returned values from impulse depend on how many outputs the caller requests.

Errors

IdentifierWhenMessage
RunMat:impulse:InvalidArgumentInputs do not match supported impulse invocation forms.impulse: invalid argument
RunMat:impulse:InvalidModelInput system is not a supported tf object with valid required metadata.impulse: invalid model
RunMat:impulse:InvalidTimeTime argument is invalid for the model class or sampling mode.impulse: invalid time input

How impulse works

  • Supports real SISO tf objects created by tf(num, den) or tf(num, den, Ts).
  • impulse(sys) uses a deterministic default time vector.
  • impulse(sys, tFinal) generates a deterministic time vector from zero to tFinal.
  • impulse(sys, t) respects an explicit real, finite, non-negative, strictly increasing time vector.
  • [y, t] = impulse(...) returns y and t as N x 1 column vectors for supported SISO systems.
  • Continuous-time responses are evaluated from a controllable canonical state-space realization.
  • Discrete-time responses respect MATLAB's unit-area impulse convention: the input pulse has height 1/Ts, and time vectors must use integer multiples of Ts.
  • Unsupported model classes, delays, complex coefficients, static gains, and non-strictly-proper transfer functions raise clear diagnostics.

GPU memory and residency

impulse returns host-resident response vectors. It does not preserve gpuArray residency.

Examples

Compute a first-order impulse response

H = tf(20, [1 5]);
t = 0:0.1:1;
[y, tout] = impulse(H, t);

Expected output:

y and tout are column vectors.

Plot an impulse response

H = tf(1, [1 3 2]);
impulse(H);

Discrete-time impulse response

H = tf(1, [1 -0.5], 0.1);
[y, t] = impulse(H, 0:0.1:0.5);

How RunMat validates impulse

impulse validates the model class, coefficient type and shape, delay properties, strict properness, sample time, and time vector before simulation. Tests cover SISO continuous response values, discrete response values, explicit time input, multi-output shapes, and representative diagnostics.

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

Using impulse with coding agents

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

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

FAQ

Does impulse support MIMO systems?

Not yet. The current implementation supports real SISO tf objects. Broader model-family and MIMO support is tracked separately.

Why are non-strictly-proper transfer functions rejected?

Those systems include a direct impulse term that is not represented as a finite numeric response vector in the current runtime model.

Can I use state-space or zero-pole-gain models?

Not yet. ss, zpk, frd, model arrays, and identified-system families are outside this first implementation.

db · dcgain · feedback · isstable · nyquist · pole · ss · step · stepinfo · tf

Open-source implementation

Unlike proprietary runtimes, every RunMat function is open-source. Read exactly how impulse 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.