Designs and analyzes impedance-controlled PCB transmission lines (microstrip, stripline, CPW, differential pairs) including RLGC extraction, trace impedance, cross-sections, and crosstalk analysis.
Ships in rf-and-mixed-signal. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
design() to auto-size lines for target impedance at a given frequencymatlab-assemble-pcb-layoutmatlab-manage-pcb-materialmatlab-analyze-emmatlab-integrate-pcb-circuitRF PCB Toolbox (default): microstripLine, pcb2D, stripLine, coplanarWaveguide, etc.
RF Toolbox (fallback only): txlineMicrostrip, txlineStripline, txlineCPW
matlab-manage-pcb-material — set up substrate and conductormemoryEstimate(obj, fc, 'RetainMesh', true) — inspect auto-mesh before solvingmatlab-analyze-em — validate S-parameters → matlab-optimize-pcb-design — tune → matlab-integrate-pcb-circuit — cascade| Object | Topology | Key Properties |
|---|---|---|
microstripLine | Single microstrip on ground | Length, Width, Height, GroundPlaneWidth |
stripLine | Signal embedded in dielectric | Length, Width, Height, GroundPlaneWidth |
coplanarWaveguide | CPW on substrate | Length, Width, Height, SlotWidth, GroundPlaneWidth |
coupledMicrostripLine | Edge-coupled microstrip pair | Length, Width, Spacing, Height |
coupledStripLine | Edge-coupled stripline pair | Length, Width, Spacing, Height |
microstripLineCustom | Custom coupled/differential microstrip | TraceType, TraceWidth, TraceSpacing, aggressor traces |
stripLineCustom | Custom coupled/differential stripline | TraceType, TraceWidth, TraceSpacing |
pcbBendCustom | Custom bend discontinuity (R2025a) | BendShape, Height, GroundPlaneWidth |
pcb2D | 2D cross-section analysis | BoardWidth, BoardCenter, Layers |
SIWLine | Substrate integrated waveguide | Length, Width, ViaSpacing, ViaDiameter |
ms = microstripLine;
show(ms);
% Design for target impedance at frequency
ms = design(microstripLine, 3e9);
Z0 = getZ0(ms);
ms = microstripLine;
ms.Length = 20e-3;
ms.Width = 5e-3;
ms.Height = 1.6e-3; % Substrate height
ms.GroundPlaneWidth = 30e-3;
ms.Substrate = dielectric("FR4");
ms.Conductor = metal("Copper");
ms.Conductor = metal("Copper"); % Required for rlgc (finite conductivity)
Z0 = getZ0(ms); % Characteristic impedance (no frequency argument)
td = propagationDelay(ms, 3e9); % Propagation delay (scalar frequency)
params = rlgc(ms, 3e9); % RLGC per unit length (scalar frequency)
freq = linspace(1e9, 6e9, 51);
sp = sparameters(ms, freq, 'SweepOption', 'interp'); % S-parameters (frequency vector OK)
rfplot(sp);
Model inverted or suspended configurations with multi-layer substrates (air gaps):
% Inverted: air below trace, substrate above ground
ms = microstripLine;
ms.Substrate = dielectric(Name={"Air","FR4"}, EpsilonR=[1 4.4], ...
LossTangent=[0 0.02], Thickness=[0.5e-3 1.6e-3]);
ms.Height = 0.5e-3 + 1.6e-3;
% Suspended: air / substrate / air
ms.Substrate = dielectric(Name={"Air","FR4","Air"}, EpsilonR=[1 4.4 1], ...
LossTangent=[0 0.02 0], Thickness=[0.3e-3 0.8e-3 0.3e-3]);
ms.Height = sum([0.3e-3 0.8e-3 0.3e-3]);
Stripline has the signal trace embedded between two ground planes.
sl = stripLine;
sl.Length = 20e-3;
sl.Width = 3e-3;
sl.Height = 3.2e-3; % Total dielectric height (top + bottom)
sl.GroundPlaneWidth = 30e-3;
sl.Substrate = dielectric("Teflon");
sl.Conductor = metal("Copper");
show(sl);
Use multi-layer dielectric with different thicknesses above and below. Height = cumulative thickness of layers below the signal (a layer boundary, not the total):
sl = stripLine;
sl.Substrate = dielectric(Name={"FR4","FR4"}, EpsilonR=[4.4 4.4], ...
LossTangent=[0.02 0.02], Thickness=[0.8e-3 1.6e-3]);
sl.Height = 0.8e-3; % Signal at the boundary between the two layers
sl = stripLine;
sl.Substrate = dielectric(Name={"Air","FR4","Air"}, ...
EpsilonR=[1 4.4 1], LossTangent=[0 0.02 0], ...
Thickness=[0.5e-3 0.8e-3 0.5e-3]);
sl.Height = 0.5e-3; % Signal at Air/FR4 boundary (0.5mm from ground)
sl = design(stripLine, 3e9); % Or design for 50-ohm at target freq
cpw = coplanarWaveguide;
cpw.Length = 20e-3;
cpw.Width = 2e-3; % Center conductor width
cpw.SlotWidth = 0.5e-3; % Gap between center and ground
cpw.Height = 1.6e-3;
cpw.GroundPlaneWidth = 10e-3;
show(cpw);
cpw = design(coplanarWaveguide, 5e9);
Z0 = getZ0(cpw);
sp = sparameters(cpw, linspace(1e9, 10e9, 51), 'SweepOption', 'interp');
rfplot(sp);
cms = coupledMicrostripLine;
cms.Length = 20e-3;
cms.Width = 2e-3;
cms.Spacing = 0.5e-3; % Gap between traces
cms.Height = 1.6e-3;
cms.Substrate = dielectric("FR4");
show(cms);
freq = 3e9;
Zeven = getZEven(cms, freq); % Even-mode impedance
Zodd = getZOdd(cms, freq); % Odd-mode impedance
Zdiff = 2 * Zodd; % Differential impedance
csl = coupledStripLine;
csl.Length = 20e-3;
csl.Width = 2e-3;
csl.Spacing = 0.3e-3;
csl.Height = 3.2e-3;
csl.Substrate = dielectric("Teflon");
cms = coupledMicrostripLine;
sub = dielectric("FR4", "Teflon");
sub.Thickness = [1.0e-3 0.5e-3]; % Set Thickness BEFORE assigning to component
cms.Substrate = sub;
cms.Height = 1.5e-3;
microstripLineCustom and stripLineCustom model differential pairs with optional aggressor traces for NEXT/FEXT crosstalk analysis.
microstripLineCustom; stripLineCustom has same interface, Teflon default, embedded between ground planes)| Property | Default | Description |
|---|---|---|
TraceType | 'Single' | 'Single' or 'Differential' (NOT 'Single-ended') |
TraceLength | 0.05 | Trace length (m) |
TraceWidth | 0.002 | Signal trace width (m) |
TraceSpacing | 0.002 | Spacing between differential pair traces (m) |
Height | 0.0016 | Substrate height (m) |
GroundPlaneWidth | (read-only) | Ground plane width — auto-computed, cannot be set |
LeftCoupledTraceGap | 0 | Gap to left aggressor trace (m); 0 = no left aggressor |
RightCoupledTraceGap | 0 | Gap to right aggressor trace (m); 0 = no right aggressor |
Substrate | FR4 | Dielectric object |
Conductor | PEC | Metal object |
ms_diff = microstripLineCustom(TraceType='Differential', ...
TraceWidth=0.002, TraceSpacing=0.0005);
show(ms_diff);
ms_diff = microstripLineCustom(TraceType='Differential', ...
TraceWidth=0.002, TraceSpacing=0.0005, ...
RightCoupledTraceGap=[0.003, 0.003], ...
LeftCoupledTraceGap=0);
show(ms_diff);
With aggressor traces, the S-parameter matrix is 6-port. Port mapping:
| Port | Trace |
|---|---|
| 1, 2 | Differential pair (near end, far end) |
| 3, 4 | Left aggressor (near end = NEXT, far end = FEXT) |
| 5, 6 | Right aggressor (near end = NEXT, far end = FEXT) |
ms = microstripLineCustom(TraceType='Differential', ...
TraceWidth=0.002, TraceSpacing=0.0005, ...
LeftCoupledTraceGap=0.003, RightCoupledTraceGap=0.003);
ms.Conductor = metal("Copper");
freq = linspace(0.1e9, 10e9, 101);
sp = sparameters(ms, freq, 'SweepOption', 'interp');
% Extract crosstalk from S-parameters
S31_dB = 20*log10(abs(squeeze(sp.Parameters(3,1,:)))); % Left NEXT
S41_dB = 20*log10(abs(squeeze(sp.Parameters(4,1,:)))); % Left FEXT
S51_dB = 20*log10(abs(squeeze(sp.Parameters(5,1,:)))); % Right NEXT
S61_dB = 20*log10(abs(squeeze(sp.Parameters(6,1,:)))); % Right FEXT
For coupled/differential lines, rlgc returns N×N matrices (off-diagonal = mutual L/C):
ms = microstripLineCustom(TraceType='Differential', ...
TraceWidth=0.002, TraceSpacing=0.0005, RightCoupledTraceGap=0.003);
ms.Conductor = metal("Copper");
params = rlgc(ms, 5e9);
pcbBendCustom and pcbTraceCustom model bend discontinuities and step-impedance transitions. See references/custom-bends-and-traces.md for properties and examples.
Substrate Integrated Waveguide uses via fences to create a waveguide in PCB.
siw = SIWLine;
siw.Length = 15.3e-3;
siw.Width = 7.4e-3;
siw.ViaSpacing = [1.2e-3 5e-3]; % [along-length, across-width]
siw.ViaDiameter = 0.51e-3;
siw.Height = 0.254e-3;
siw.Substrate = dielectric(Name="RO4003C", EpsilonR=3.38, LossTangent=0.0027, Thickness=0.254e-3);
siw.Conductor = metal("Copper");
show(siw);
sp = sparameters(siw, linspace(20e9, 40e9, 51), 'SweepOption', 'interp');
rfplot(sp);
The SIW has a FeedLine property (a traceTapered object) for the microstrip-to-SIW transition.
Creates a 2D cross-section model for fast per-unit-length analysis. Much faster than full 3D sparameters for uniform transmission line characterization.
p = pcb2D;
p = pcb2D(Name=Value);
Key Properties:
Name — Descriptive name for the cross-sectionBoardWidth — Total board width (m)BoardCenter — Center position of the board cross-sectionLayers — Cell array of trace2D and dielectric objects defining the stackupMethods: show(p), sparameters(p, freq), rlgc(p, scalarFreq), propagationDelay(p, scalarFreq)
Represents a trace cross-section for use inside a pcb2D object's Layers cell array.
t = trace2D;
t.Type = 'Signal'; % 'Signal' (default) or 'Ground'
t.Shape = shape.Rectangle(Length=0.3e-3, Width=35e-6); % Length=trace width, Width=trace thickness
t.Conductor = metal("Copper");
Key Properties: Type ('Signal'/'Ground'), Shape (shape.Rectangle — Length = trace width, Width = metal thickness), Conductor, TrapezoidalEtchAngle
sub = dielectric("FR4");
sub.Thickness = 0.2e-3;
sig = trace2D;
sig.Type = 'Signal';
sig.Shape = shape.Rectangle(Length=0.3e-3, Width=35e-6);
sig.Conductor = metal("Copper");
gnd = trace2D;
gnd.Type = 'Ground';
gnd.Shape = shape.Rectangle(Length=5e-3, Width=35e-6);
p = pcb2D(BoardWidth=5e-3, Layers={sig, sub, gnd});
show(p);
params = rlgc(p, 10e9);
fprintf('L = %.2f nH/m, C = %.2f pF/m\n', params.L*1e9, params.C*1e12);
Multiple traces on the same metal layer must be passed as a trace2D array [sig1, sig2], not separate cells:
sub = dielectric("FR4");
sub.Thickness = 0.2e-3;
sig1 = trace2D;
sig1.Type = 'Signal';
sig1.Shape = shape.Rectangle(Length=0.15e-3, Width=35e-6);
sig1.Shape.Center = [-0.2e-3 0];
sig1.Conductor = metal("Copper");
sig2 = trace2D;
sig2.Type = 'Signal';
sig2.Shape = shape.Rectangle(Length=0.15e-3, Width=35e-6);
sig2.Shape.Center = [0.2e-3 0];
sig2.Conductor = metal("Copper");
gnd = trace2D;
gnd.Type = 'Ground';
gnd.Shape = shape.Rectangle(Length=5e-3, Width=35e-6);
p = pcb2D(BoardWidth=5e-3, Layers={[sig1, sig2], sub, gnd});
show(p);
params = rlgc(p, 10e9); % Returns 2x2 L and C matrices for coupled pair
| Scenario | Approach |
|---|---|
| Impedance/RLGC of uniform cross-section | pcb2D — milliseconds |
| Discontinuities (bends, steps, stubs) | 3D sparameters — minutes |
| Differential pair coupling | pcb2D with [sig1, sig2] array |
slice extracts a 2-D cross section from a pcbComponent (convert catalog objects first):
cms = design(coupledMicrostripLine, 3e9);
cms.Conductor = metal("Copper");
pcb2d = slice(pcbComponent(cms));
params = rlgc(pcb2d, 3e9);
The design function sizes a transmission line for a target frequency (and optionally impedance):
ms = design(microstripLine, 3e9); % Default 50-ohm at 3 GHz
sl = design(stripLine, 5e9); % Default 50-ohm at 5 GHz
cpw = design(coplanarWaveguide, 10e9); % Default 50-ohm at 10 GHz
After design, verify with getZ0:
Z0 = getZ0(ms); % Should be ~50 ohm
Interactive app for designing and analyzing transmission lines:
transmissionLineDesigner
Select line type, set dimensions/materials interactively, analyze impedance/S-parameters/RLGC, and export designs to workspace.
| Problem | Adjust | Direction |
|---|---|---|
| Z0 too high | Width | Increase |
| Z0 too low | Width | Decrease |
| Too lossy | Conductor thickness | Increase |
| Wrong electrical length | Length | Adjust |
Use interpolating sweep for S-parameters: Always use sparameters(obj, freq, 'SweepOption', 'interp') — direct sweeps are significantly slower.
Check mesh density before solving: Run memoryEstimate(obj, fc, 'RetainMesh', true) before sparameters(). If too dense, coarsen: mesh(obj, 'MaxEdgeLength', lambda/6). See matlab-analyze-em.
Height meaning differs by topology: For microstrip, Height = dielectric thickness. For stripline with multi-layer substrate, Height must equal a cumulative layer boundary — it defines where the signal sits in the stack.
Width controls impedance: Wider trace → lower impedance. Use design() to auto-size, then adjust manually if needed.
Conductor defaults to PEC: Without assigning metal("Copper"), loss will be zero. Always set Conductor for realistic insertion loss.
Inverted/suspended microstrip Height rule: For inverted microstrip, create multi-layer dielectric with Name={"Substrate","Air"} and set Height to air layer thickness. For suspended microstrip, Height = sum of air + substrate thickness.
Multi-layer stripline Height is a layer boundary, not total: Height must equal a cumulative layer boundary from Thickness vector. Setting Height to total causes "Expected Height must be among the substrate layers."
SIW cutoff: SIW has a cutoff frequency below which signals do not propagate. Size the width for operation well above cutoff.
getZ0 takes no frequency: getZ0(obj) returns characteristic impedance directly. Do not pass a frequency argument.
rlgc requires finite conductivity: Assign metal("Copper") before calling rlgc. Default PEC causes "Conductivity value must be finite with 2D field solver."
Multi-layer Name must use cell array: Use Name={"Air","FR4"} (cell array), not Name=["Air","FR4"] (string array).
trace2D uses Shape, not Width/Thickness: Set t.Shape = shape.Rectangle(Length=traceWidth, Width=metalThickness). Note: shape.Rectangle.Length = trace width, .Width = metal thickness. A pcb2D requires at least one 'Ground' type trace.
pcb2D rlgc takes scalar frequency: rlgc(p, freq) requires a scalar, not a vector. Loop or call once at the frequency of interest.
pcb2D trace2D Center is x-position only: trace2D.Shape.Center controls horizontal position. Vertical is from layer stacking order. Set Center = [x_offset 0].
Same-layer traces need array, not separate cells: For coupled/differential traces on the same metal layer, use Layers={[sig1, sig2], sub, gnd}. Separate cells {sig1, sig2, sub, gnd} treats them as different metal layers and errors: "dielectric layer must be between metal layers."
Crosstalk port count depends on aggressor configuration: Both aggressors → 6-port; one → 4-port; none → 2-port. RightCoupledTraceGap=Inf removes that aggressor.
TraceGap is edge-to-edge, not center-to-center: Measures gap between nearest edges, not trace centers.
Use TraceWidth, not Width: microstripLineCustom and stripLineCustom use TraceWidth. Setting Width silently has no effect.
matlab-manage-pcb-material — Substrate and conductor setupmatlab-analyze-em — S-parameter extraction and field analysismatlab-integrate-pcb-circuit — Touchstone export, circuit cascadingmatlab-assemble-pcb-layout — Custom trace geometriesCopyright 2026 The MathWorks, Inc.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/rf-and-mixed-signal:matlab-design-pcb-transmission-linefrom rf-and-mixed-signal
npx claudepluginhub matlab/matlab-agentic-toolkit --plugin rf-and-mixed-signal21 skills in this plugin
/matlab-analyze-ams-waveformAnalyze AMS waveform data using Mixed-Signal Blockset utilities: phase noise measurement, clock jitter, anti-aliased resampling, timing measurements, lock time, INL/DNL, ADC/DAC calibration, HSpice import. Use when analyzing time-domain voltage from PLL/VCO/clock simulations, measuring phase noise from variable-step solver output, computing jitter, or resampling non-uniform data./matlab-analyze-antenna-structuresDesign and analyze electrically large antenna structures using MATLAB Antenna Toolbox. Covers reflector antennas (parabolic, Cassegrain, Gregorian, offset, corner, cylindrical, spherical, custom STL), reflectarrays and reconfigurable intelligent surfaces (RIS), antennas installed on platforms (vehicles, aircraft, ships, satellites), and radar cross section (RCS) analysis. Includes solver selection (MoM-PO, PO, MoM, FMM), mesh control, and GPU acceleration. Use when the user wants to design a dish/reflector antenna, reflectarray, analyze an antenna on a platform, or compute RCS.
/matlab-analyze-emS-parameters, insertion loss, fields, currents, mesh control, and solver selection for RF PCB performance validation. TRIGGER: user asks to compute S-parameters, analyze insertion/return loss, extract fields or currents, compare MoM vs FEM, or control mesh for any RF PCB component. Invoke BEFORE writing sparameters() or solver code — API is non-obvious. SKIP: designing or creating components (use the specific matlab-design-pcb-* skill), material/stackup setup only (use matlab-manage-pcb-material), optimization sweeps (use matlab-optimize-pcb-design), PDN/IR-drop analysis (use matlab-analyze-pcb-pdn)./matlab-analyze-pcb-pdnPDN DC voltage/current analysis, IR drop, design rule checking, and multi-net batch analysis on imported PCB layouts. TRIGGER: user asks about power integrity, PDN analysis, IR drop, voltage distribution, current density, power nets, or design rule checking on a PCB. Invoke BEFORE writing code — the PDN API chain is specialized and non-obvious. SKIP: importing a PCB file (use matlab-read-pcb-layout), EM field/S-parameter extraction (use matlab-analyze-em), material/stackup setup only (use matlab-manage-pcb-material), transmission line design (use matlab-design-pcb-transmission-line)./matlab-assemble-pcb-layoutBuild custom PCB structures with pcbComponent, shapes, Boolean ops, feeds, and multi-layer stackups for non-catalog geometries. TRIGGER: user asks to build, modify, or customize a pcbComponent — add/remove shapes, edit polygons, place feeds, add metal layers, cut slots, or create non-catalog RF structures. Also when modifying geometry of an existing catalog-designed component (e.g., adding pads, removing elements, editing vertices). Invoke BEFORE writing pcbComponent code — layer/shape/feed API is non-obvious. SKIP: designing catalog components like filters/couplers/txlines (use the specific matlab-design-pcb-* skill), material/stackup definition only (use matlab-manage-pcb-material), EM analysis (use matlab-analyze-em), importing PCB files (use matlab-read-pcb-layout)./matlab-design-antennaDesign antennas, arrays, and PCB antennas using MATLAB Antenna Toolbox. Covers catalog antenna design and pattern analysis, custom antenna construction (customAntenna + shape.*), PCB antenna design (pcbStack + antenna.*), finite and infinite array design, AI-accelerated design exploration (AIAntenna, patternFromAI), and optimization (SADEA/TR-SADEA). Use when the user wants to design, create, model, analyze, optimize, or fabricate an antenna or array.
Other plugins' skills for the same job