RunMat
GitHub

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

NameTypeRequiredDefaultDescription
bNumericArrayYesNumerator coefficient vector or zero locations.
aNumericArrayYesDenominator coefficient vector or pole locations.
zNumericArrayYesZero locations.
pNumericArrayYesPole locations.
kNumericScalarNoSystem gain; accepted for zpk compatibility and ignored for plotting.
sosNumericArrayYesSecond-order-section matrix with six columns [b0 b1 b2 a0 a1 a2].

Returns

NameTypeDescription
hNumericArrayGraphics handles for zeros, poles, unit circle, and axes guides.

Errors

IdentifierWhenMessage
RunMat:zplane:InvalidArgumentInputs cannot be interpreted as filter coefficients, zero/pole vectors, or SOS rows.zplane: invalid argument
RunMat:zplane:InternalInternal plotting state or tensor construction fails.zplane: internal operation failed

How zplane works

  • zplane(b, a) computes roots(b) and roots(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.

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

Rounding

ceil · fix · floor · mod · rem · round

Factor

chol · eig · lu · qr · svd

Solve

cond · det · inv · linsolve · norm · null · pinv · rank · rcond · rref

Symbolic

digits · int · limit · sym · syms · vpa

Fft

fft · fft2 · fftshift · ifft · ifft2 · ifftshift

Interpolation

interp1 · interp2 · pchip · ppval · spline

Ode

ode15s · ode23 · ode45

Open-source implementation

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