step — Compute or plot step responses of SISO transfer-function models with MATLAB-compatible step forms.
step(sys, ...) plots or returns the sampled unit-step response of a supported SISO transfer-function model. With no time argument RunMat chooses a suitable grid; a scalar sets the final time and a vector supplies exact sample times. Typed-integer time values are available in RunMat mode and must be exactly representable in binary64 before entering the floating control-system simulation.
Syntax
y = step(sys)
y = step(sys, tFinal)
y = step(sys, t)
[y,t] = step(sys)
[y,t] = step(sys, tFinal)
[y,t] = step(sys, t)Inputs
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
sys | Any | Yes | — | SISO tf model. |
time | Any | No | — | Final time scalar or explicit time vector. |
Returns
| Name | Type | Description |
|---|---|---|
y | NumericArray | Step response samples (column vector). |
t | NumericArray | Time samples (column vector). |
Returned values from step depend on how many outputs the caller requests.
Errors
| Identifier | When | Message |
|---|---|---|
RunMat:step:InvalidArgument | Inputs do not match supported step invocation forms. | step: invalid argument |
RunMat:step:InvalidModel | Input system is not a supported tf object with valid required properties. | step: invalid model |
RunMat:step:InvalidTime | Time argument is invalid for the model class or sampling mode. | step: invalid time input |
RunMat:step:UnsupportedModel | Model is well-formed but unsupported by the current step implementation. | step: unsupported model |
RunMat:step:DiscreteLimit | Discrete simulation would exceed platform or configured sample limits. | step: discrete simulation limit exceeded |
RunMat:step:PlotFailed | Statement-form plotting failed for reasons other than known nonfatal setup conditions. | step: plotting failed |
RunMat:step:Internal | Internal response assembly failed. | step: internal error |
How step works
- Supports SISO
tfobjects with real coefficients. - Returns the response
yas a column vector for single-output calls. - Returns
[y, tOut]for two-output calls. - Plots the response for no-output calls.
- No-output calls accept common multi-system plot syntax such as
step(sys1, 'b', sys2, 'r--', tFinal); style tokens are accepted for compatibility. - Chooses an automatic time vector when no time input is supplied.
- Accepts a positive finite scalar final time.
- Accepts a finite, nonnegative, nondecreasing explicit time vector.
- Discrete-time models use the stored
Tssample time. - Native typed-integer
tandtFinalare RunMat extensions. Compatibility admission and exact-representability checks happen before provider access, and wide integers that would round as double are rejected. - Response values and returned time coordinates are double because transfer-function simulation is an explicit floating computation domain; integer time input does not imply an integer output class.
GPU memory and residency
step computes on the host from tf metadata and returns host tensors.
Examples
Returning response data for a first-order system
sys = tf(1, [1 1]);
[y, t] = step(sys);Expected output:
y and t are column vectors.Using a scalar final time
sys = tf(1, [1 1]);
[y, t] = step(sys, 5);Expected output:
t(end) = 5Using an explicit time vector
sys = tf(1, [1 1]);
t = 0:0.5:2;
y = step(sys, t);Expected output:
y is sampled at the values in t.Plotting the step response
sys = tf(1, [1 1]);
step(sys);Expected output:
A step-response plot is rendered.Plotting multiple systems
s = tf('s');
H1 = 1/(s + 1);
H2 = 2/(s + 2);
step(H1, 'b', H2, 'r--', 5);Expected output:
Both responses are plotted over the same final time.How RunMat validates step
step validates object class, coefficient type, properness, sample time, and time-vector inputs before simulation. Unit and integration tests cover first-order response values, scalar final time, explicit vectors, discrete sample-time behavior, multi-output ordering, multi-system statement-form plotting syntax, and VM dispatch.
- Implementation: `crates/runmat-runtime/src/builtins/control/step.rs`
See Correctness & Trust for the full methodology and coverage table.
Using step with coding agents
Open a RunMat example with live inputs, then ask the agent to explain how step changes the result.
Run a small step example, explain the result, then change one input and compare the output.
FAQ
Does step support MIMO models?⌄
Not yet. This implementation starts with SISO transfer-function objects.
Does step support state-space models?⌄
Not yet. The initial implementation supports transfer-function objects produced by tf.
Can transfer-function coefficients be complex?⌄
Not in this first implementation. Complex coefficients return a clear unsupported-input error.
Related Control functions
damp · db · dcgain · feedback · impulse · isstable · lqr · nyquist · pole · pzmap · rlocus · ss · stepinfo · tf · zero
Open-source implementation
Unlike proprietary runtimes, every RunMat function is open-source. Read exactly how step is executed, line by line, in Rust.
- View the source for step 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.