pzmap — Plot or return pole-zero locations for SISO transfer-function and state-space models.
pzmap(sys) plots poles and zeros for supported SISO tf and ss models. Output forms return pole and zero locations as column vectors.
Syntax
pzmap(sys)
p = pzmap(sys)
[p,z] = pzmap(sys)Inputs
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
sys | Any | Yes | — | SISO tf or ss model. |
Returns
| Name | Type | Description |
|---|---|---|
p | Any | Poles of the SISO tf or ss model as a column vector. |
z | Any | Zeros of the SISO tf or ss model as a column vector. |
Returned values from pzmap depend on how many outputs the caller requests.
Errors
| Identifier | When | Message |
|---|---|---|
RunMat:pzmap:InvalidArgument | Inputs do not match supported pzmap invocation forms. | pzmap: invalid argument |
RunMat:pzmap:InvalidModel | Input system is not a valid SISO tf object. | pzmap: invalid model |
RunMat:pzmap:UnsupportedModel | Model form is not supported by the current implementation. | pzmap: unsupported model |
RunMat:pzmap:PlotFailed | Statement-form plotting failed for reasons other than known nonfatal setup conditions. | pzmap: plotting failed |
RunMat:pzmap:Internal | Pole-zero extraction or output construction failed. | pzmap: internal error |
How pzmap works
- Supports SISO
tfobjects with real or complex coefficients. - Supports SISO
ssobjects by converting the state-space model to a transfer-function numerator and denominator. - No-output calls plot poles with
xmarkers and zeros withomarkers on the complex plane. - Statement-form plotting accepts one or more
tforsssystems. - Statement-form plotting accepts optional line-spec color/style arguments after each system, such as
pzmap(sys1, 'r', sys2, 'b'); pole and zero markers for the same system use the same color. - Two-output calls return
[p, z], where each output is a column vector. - Single-output calls return the pole column vector.
- Outputs use complex tensors when any pole or zero has a nonzero imaginary component.
- Input/output delays raise clear unsupported-model diagnostics.
GPU memory and residency
pzmap returns host-resident pole and zero tensors.
Examples
Return poles and zeros
H = tf([1 3 2], [1 4]);
[p, z] = pzmap(H);
fprintf("%.0f %.0f %.0f\n", p(1), z(1), z(2));Expected output:
-4 -1 -2Plot a pole-zero map
s = tf('s');
H = (s + 2) / (s^2 + 3*s + 4);
pzmap(H);
fprintf("ok\n");Expected output:
okHandle state-space models
sys = ss(-1, 1, 1, 0);
[p, z] = pzmap(sys);
fprintf("%.0f %d\n", p(1), length(z));Expected output:
-1 0Handle complex poles
H = tf(1, [1 0 1]);
[p, z] = pzmap(H);
fprintf("%d %d\n", length(p), length(z));Expected output:
2 0How RunMat validates pzmap
pzmap validates object class, delay properties, output shapes, real and complex root extraction, plotting smoke, multi-system statement form, and VM dispatch.
- Implementation: `crates/runmat-runtime/src/builtins/control/pzmap.rs`
See Correctness & Trust for the full methodology and coverage table.
Using pzmap with coding agents
Open a RunMat example with live inputs, then ask the agent to explain how pzmap changes the result.
Run a small pzmap example, explain the result, then change one input and compare the output.
FAQ
Does pzmap support state-space models?⌄
Yes. RunMat supports SISO ss models by converting the state-space matrices to a transfer-function representation before computing poles and zeros. MIMO state-space models are rejected with an unsupported-model diagnostic.
What does pzmap return with one output?⌄
RunMat returns the pole column vector. Use [p, z] = pzmap(sys) when zero locations are needed.
Does pzmap run on the GPU?⌄
No. It is a model-analysis and plotting operation and returns host-resident tensors.
Related Control functions
damp · db · dcgain · feedback · impulse · isstable · lqr · nyquist · pole · rlocus · ss · step · stepinfo · tf · zero
Open-source implementation
Unlike proprietary runtimes, every RunMat function is open-source. Read exactly how pzmap is executed, line by line, in Rust.
- View the source for pzmap 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.