zplane — Plot zeros and poles of a digital filter.
zplane draws the unit circle, real and imaginary axes, and markers for filter zeros and poles. Row-vector inputs are interpreted as transfer-function coefficients b and a; column-vector inputs are interpreted as explicit zero and pole locations.
Syntax
zplane(b, a)
zplane(z, p, k)
zplane(sos)
h = zplane(...)Inputs
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
b | NumericArray | Yes | — | Numerator coefficient vector or zero locations. |
a | NumericArray | Yes | — | Denominator coefficient vector or pole locations. |
z | NumericArray | Yes | — | Zero locations. |
p | NumericArray | Yes | — | Pole locations. |
k | NumericScalar | No | — | System gain; accepted for zpk compatibility and ignored for plotting. |
sos | NumericArray | Yes | — | Second-order-section matrix with six columns [b0 b1 b2 a0 a1 a2]. |
Returns
| Name | Type | Description |
|---|---|---|
h | NumericArray | Graphics handles for zeros, poles, unit circle, and axes guides. |
Errors
| Identifier | When | Message |
|---|---|---|
RunMat:zplane:InvalidArgument | Inputs cannot be interpreted as filter coefficients, zero/pole vectors, or SOS rows. | zplane: invalid argument |
RunMat:zplane:Internal | Internal plotting state or tensor construction fails. | zplane: internal operation failed |
How zplane works
zplane(b, a)computesroots(b)androots(a)and plots the resulting zeros and poles.zplane(z, p, k)accepts explicit zero and pole locations; the gain is validated for compatibility and does not affect marker placement.zplane(sos)accepts a second-order-section matrix with six columns[b0 b1 b2 a0 a1 a2]and plots all section roots.- The plot uses equal axis scaling, grid lines, the unit circle, and symmetric limits large enough to include all finite zeros and poles.
- When assigned,
h = zplane(...)returns a row vector of graphics handles for the guide lines and marker plots.
Does RunMat run zplane on the GPU?
Host-side root extraction and plotting only.
GPU coefficient inputs are gathered before evaluation.
Examples
Plot zeros and poles of a simple IIR filter
b = 1;
a = [1 -0.8];
zplane(b, a);
title('Zero-Pole Plot');Use explicit zero and pole vectors
z = [0.2; -0.2];
p = [0.8; 0.6];
zplane(z, p, 1);Plot roots from second-order sections
sos = [1 0 0 1 -0.8 0];
zplane(sos);Using zplane with coding agents
Open a RunMat example with live inputs, then ask the agent to explain how zplane changes the result.
Run a small zplane example, explain the result, then change one input and compare the output.
FAQ
How does RunMat distinguish coefficients from explicit zeros and poles?⌄
Row-vector two-argument inputs are treated as transfer-function coefficients. Column-vector two-argument inputs are treated as explicit zero and pole locations, matching the common MATLAB zplane convention.
Does zplane compute the frequency response?⌄
No. zplane only computes roots and renders the zero-pole diagram. Use freqz to compute or plot frequency response values.
Related Math functions
Signal
blackman · butter · buttord · conv · conv2 · deconv · downsample · envelope · filter · filtfilt · fir1 · freqz · gauspuls · hamming · hann · hilbert · periodogram · pulstran · pwelch · rectpuls · sawtooth · sinc · spectrogram · square · tripuls · unwrap · upsample
Elementwise
abs · angle · complex · conj · double · exp · expm1 · factorial · gamma · heaviside · hypot · imag · ldivide · log · log10 · log1p · log2 · minus · nextpow2 · plus · pow2 · power · rdivide · real · sign · single · sqrt · times
Trigonometry
acos · acosh · asin · asinh · atan · atan2 · atanh · cos · cosd · cosh · deg2rad · rad2deg · sin · sind · sinh · tan · tand · tanh
Reduction
all · any · cummax · cummin · cumprod · cumsum · cumtrapz · diff · gradient · max · mean · median · min · nnz · prod · std · sum · trapz · var
Structure
Open-source implementation
Unlike proprietary runtimes, every RunMat function is open-source. Read exactly how zplane is executed, line by line, in Rust.
- View the source for zplane 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.