step — Compute or plot the unit-step response of a SISO transfer function.
step(sys) samples the response to a unit step. A positive finite scalar sets the final time; a real vector supplies exact sample times. With outputs, the operation returns an N-by-1 double response and, optionally, its time coordinates. Without outputs it plots the response.
Syntax
step(sys)
step(sys, tFinal)
step(sys, t)
step(sys1, style1, sys2, style2, tFinal)
y = step(sys)
y = step(sys, tFinal)All supported step forms
step(sys)
step(sys, tFinal)
step(sys, t)
step(sys1, style1, sys2, style2, tFinal)
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
sys- Type
Any- Required
- Yes
- Description
- SISO tf model.
time- Type
Any- Required
- No
- Description
- Final time scalar or explicit time vector.
sys1- Type
Any- Required
- Yes
- Description
- First SISO tf model.
style1- Type
StyleSpec- Required
- Yes
- Description
- Plot style for the first model.
sys2- Type
Any- Required
- Yes
- Description
- Second SISO tf model.
style2- Type
StyleSpec- Required
- Yes
- Description
- Plot style for the second model.
tFinal- Type
NumericScalar- Required
- Yes
- Description
- Shared final time for the plotted models.
Returns
y- Type
NumericArray- Description
- Step response samples (column vector).
t- Type
NumericArray- Description
- Time samples (column vector).
Returned values from step depend on how many outputs the caller requests.
Errors
RunMat:step:InvalidArgument- When
- Inputs do not match supported step invocation forms.
- Message
step: invalid argument
RunMat:step:InvalidModel- When
- Input system is not a supported tf object with valid required properties.
- Message
step: invalid model
RunMat:step:InvalidTime- When
- Time argument is invalid for the model class or sampling mode.
- Message
step: invalid time input
Models and time
Supported models are real SISO tf objects with proper numerator/denominator degree, a known nonnegative sample time, and zero input/output delay. State-space, MIMO, complex-coefficient, delayed and improper models are not yet simulated. The response of a discrete-time model uses its stored Ts.
With no time argument RunMat selects a grid. A scalar final time is positive and finite; an explicit vector is finite, nonnegative, and nondecreasing. Discrete-time samples must align with Ts. Output response and time coordinates are double column vectors.
No-output calls also accept multiple model/style pairs followed by one time argument, for example step(sys1, 'b', sys2, 'r--', 5). Style arguments belong to the preceding model. A malformed model or time argument is rejected before plotting begins.
Typed-integer time input is a RunMat-only extension. Typed-integer tf coefficients or Ts and logical tf coefficients assigned after construction use separate model-property gates. Integer time and model-property values must be exactly representable in binary64 at the host simulation boundary; wide integers that would round are rejected. The MATLAB compatibility mode rejects these extensions before provider access.
Execution and placement
Response simulation is host-side and ends fusion. Required resident tf properties and time input gather through their owning provider after locally decidable validation; unrelated object properties are not consumed. Returned numeric arrays are host-resident.
No-output calls may use the user-interface capability to produce a plot. Output-producing calls have no plotting effect. Native and browser execution depend on the available plotting service; this contract does not claim a GPU response kernel.
Examples
First-order response
sys = tf(1, [1 1]); [y,t] = step(sys, [0 1 2]); fprintf('%d %d %d %d\n', size(y,1), size(y,2), size(t,1), size(t,2));Expected output:
3 1 3 1Scalar final time
sys = tf(1, [1 1]); [y,t] = step(sys, 5); fprintf('t(end) = %g\n', t(end));Expected output:
t(end) = 5Discrete response
sys = tf(1, [1 -0.5], 0.1); [y,t] = step(sys, [0 0.1 0.2]);RunMat integer time
sys = tf(1, [1 1]); [y,t] = step(sys, uint16([0 1 2]));Plot a step response
sys = tf(1, [1 1]); step(sys); fprintf('ok\n');Expected output:
okPlot two systems
H1 = tf(1, [1 1]); H2 = tf(2, [1 2]); step(H1, 'b', H2, 'r--', 5); fprintf('ok\n');Expected output:
okUsing 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. The current response simulator supports SISO transfer-function objects.
Does step support state-space models?⌄
Not yet. The current response simulator accepts tf objects; ss support remains outside this implementation.
Can coefficients be complex?⌄
No. Non-real tf coefficients return an unsupported-model diagnostic.
Related Control functions
Source you can read
Every RunMat function's source is public. 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 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.