SkillAgentSearch skills...

matlab-integrate-pcb-circuit

Cascade PCB components, add lumped elements, export Touchstone, and bridge to eye diagram or antenna array workflows. TRIGGER: user asks to cascade or connect multiple RF PCB components, add lumped R/L/C, export S-parameters to Touchstone, or combine PCB elements into a circuit.

Install / Use

npx skills add matlab/matlab-agentic-toolkit --skill matlab-integrate-pcb-circuit

Installs into whichever agent you are using.

About this skill
📄

SKILL.md

Installable skill definition

Quality Score

93/100

Category

Automation

Supported Platforms

Universal

Our assessment of matlab-integrate-pcb-circuit

matlab-integrate-pcb-circuit scores 93/100 on our quality scale, 750th of 2,846 Automation skills we index (top 27%).

Its SKILL.md is 18 KB long, well organised into 39 sections with 20 code examples: a thorough specification that gives an agent plenty to work with.

With 1,098 GitHub stars, it is one of the more widely adopted skills in the catalogue.

Substance
30/30
Structure
20/20
Description
15/15
Adoption
13/20
Freshness
15/15

Maintenance, license and trust

  • The repository was last updated 18 days ago, so matlab-integrate-pcb-circuit is actively maintained.
  • No license is declared. By default that means all rights are reserved: you can read it, but reusing or redistributing it is not clearly permitted. Ask the author before building on it commercially.
  • Its trust signals score 88/100, with 1 caution from licensing, adoption, age or documentation. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.

matlab-integrate-pcb-circuit compared with similar skills

All 4 of these similar skills score higher than matlab-integrate-pcb-circuit; compare them before choosing.

SkillScoreStarsUpdatedFormat
matlab-integrate-pcb-circuit (this skill)by matlab931.1k18d agoSKILL.md
Agent-Reachby Panniantong10089.8k18d agoCLAUDE.md
Scraplingby D4Vinci10085.4ktodayMCP Server
rufloby ruvnet10073.8ktodayMCP Server
algorithmic-artby anthropics100177.9k11d agoSKILL.md

Frequently asked questions

How do I install matlab-integrate-pcb-circuit?
Run npx skills add matlab/matlab-agentic-toolkit --skill matlab-integrate-pcb-circuit. The install tabs above show the steps for each supported agent.
Which AI agents does matlab-integrate-pcb-circuit work with?
It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
Is matlab-integrate-pcb-circuit safe to use?
It declares no license and scores 88/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
Is matlab-integrate-pcb-circuit still maintained?
The repository was last updated 18 days ago, so matlab-integrate-pcb-circuit is actively maintained.

name: matlab-integrate-pcb-circuit description: "Cascade PCB components, add lumped elements, export Touchstone, and bridge to eye diagram or antenna array workflows. TRIGGER: user asks to cascade or connect multiple RF PCB components, add lumped R/L/C, export S-parameters to Touchstone, or combine PCB elements into a circuit. Invoke BEFORE writing pcbcascade or circuit code — cascade rules and port matching are non-obvious. SKIP: designing individual components (use the specific matlab-design-pcb-* skill), EM analysis of a single component (use matlab-analyze-em), material/stackup setup only (use matlab-manage-pcb-material), optimization (use matlab-optimize-pcb-design)." license: https://www.mathworks.com/content/dam/mathworks/license/pmrl/license.md metadata: author: MathWorks version: "1.0"

Cascading and Integrating RF PCB Components

When to Use

  • Cascading two or more PCB components end-to-end with pcbcascade
  • Wrapping PCB components as circuit elements with pcbElement for RF Toolbox
  • Loading internal ports with lumped elements (varactors, terminators)
  • Exporting S-parameters to Touchstone files via rfwrite
  • Integrating RF PCB feed networks with antenna arrays
  • Bridging to Signal Integrity Toolbox for eye diagram analysis

When NOT to Use

  • Designing individual filters, couplers, or transmission lines — use the respective designing skill
  • Building custom PCB geometry from scratch — use matlab-assemble-pcb-layout
  • Running EM analysis on a single component — use matlab-analyze-em
  • Setting up materials — use matlab-manage-pcb-material

Typical Workflow

  1. Before: Design skills (matlab-design-pcb-filter, matlab-design-pcb-coupler, etc.) or matlab-analyze-em — create and validate individual components
  2. This skill: Cascade components, add lumped elements, export Touchstone, bridge to eye diagram analysis
  3. After: matlab-write-pcb-layout — export final design to Gerber; or feed S-parameters into Signal Integrity Toolbox workflows

Quick Reference

| Task | Code | |------|------| | Cascade two components | out = pcbcascade(comp1, comp2) | | Cascade with rectangular board | out = pcbcascade(comp1, comp2, 'RectangularBoard', true) | | Interactive cascade | pcbcascade(comp1, comp2, 'Interactive', true) | | Create circuit element | elem = pcbElement(comp) | | Set analysis ports | elem.AnalysisPorts = {1, 2} | | Attach lumped elements | elem.PortNumber = {3, 4}; elem.PortValue = {capacitor(2.2e-12), resistor(50)} | | Add to RF circuit | add(ckt, [1 2 0 0], elem) | | Export to Touchstone | rfwrite(sp, 'comp.s2p') | | Export with options | rfwrite(sp, 'comp.s2p', FrequencyUnit='GHz', Format='DB') |

pcbcascade — Connecting Components End-to-End

The pcbcascade function joins two RF PCB components port-to-port, producing a single pcbComponent for full-wave analysis.

Basic Cascade

HPF = filterStub;
HPF.StubShort = [1 1 1 1 1];
HPF.Height = 0.508e-3;
% ... set HPF properties ...

LPF = filterStepImpedanceLowPass;
LPF.Height = 0.508e-3;
LPF = design(LPF, 7e9);

BPF = pcbcascade(LPF, HPF, "RectangularBoard", true);
show(BPF);

Analyzing the Cascade

freq = linspace(1e6, 12e9, 51);
sp = sparameters(BPF, freq, 'SweepOption', 'interp');
rfplot(sp);

RectangularBoard Option

| Value | Behavior | |-------|----------| | true | Creates a rectangular dielectric board around the cascaded layout | | false (default) | Uses the natural board shape from the component geometries |

Interactive Cascade Mode

For visual port alignment:

pcbcascade(comp1, comp2, 'Interactive', true);

This launches a GUI that lets you visually connect ports and adjust spacing.

Multi-Stage Cascade

Chain more than two components by cascading sequentially:

stage1 = design(filterStepImpedanceLowPass, 5e9);
stage2 = design(microstripLine, 5e9);
stage3 = design(filterStepImpedanceLowPass, 5e9);

% Match substrates — design() defaults differ across object types
stage2.Substrate = stage1.Substrate;
stage2.Height = stage1.Height;
stage2.Conductor = stage1.Conductor;
stage3.Substrate = stage1.Substrate;
stage3.Height = stage1.Height;
stage3.Conductor = stage1.Conductor;

% Cascade stage1 + stage2, then result + stage3
intermediate = pcbcascade(stage1, stage2, 'RectangularBoard', true);
final = pcbcascade(intermediate, stage3, 'RectangularBoard', true);
show(final);

Cascade Requirements

  • Both components must share the same substrate (Height, Substrate)
  • Port line widths should match at the connection interface
  • Components connect at their port edges (port 2 of comp1 to port 1 of comp2)

pcbElement — RF Toolbox Circuit Integration

pcbElement wraps an RF PCB component as a circuit element usable in the RF Toolbox circuit framework. This enables hybrid distributed+lumped modeling.

Basic Usage

comp = design(couplerBranchline, 5e9);
elem = pcbElement(pcbComponent(comp));
S = sparameters(elem, linspace(3e9, 7e9, 51), 'SweepOption', 'interp');
rfplot(S);

Behavioral vs Full-Wave

% Behavioral model (fast, uses analytic approximation)
elem = pcbElement(comp, 'Behavioral', true);

% Full-wave solve (accurate, uses MoM)
elem = pcbElement(comp, 'Behavioral', false);

Not all components support behavioral mode. If unsupported, a warning is issued and full-wave is used automatically.

Adding pcbElement to a Circuit

ckt = circuit;
c1 = interdigitalCapacitor;
c2 = interdigitalCapacitor('NumFingers', 3);
p = pcbElement(c2, 'Behavioral', false);
add(ckt, [1 2 0 0], c1);    % Default pcbElement created automatically
add(ckt, [2 3 0 0], p);
setports(ckt, [1 0], [3 0]);
S = sparameters(ckt, 8e9);

Hybrid Distributed+Lumped Modeling with Internal Ports

The most powerful use of pcbElement is connecting lumped components (capacitors, resistors, inductors) to internal ports on an EM structure. This models tunable filters with varactors, loaded resonators, and bias-T networks.

Concept

  1. Define extra FeedLocations on the PCB as internal port pairs
  2. Wrap with pcbElement
  3. Assign AnalysisPorts (external I/O ports for S-parameter extraction)
  4. Assign PortNumber (internal port indices to load)
  5. Assign PortValue (lumped elements connected at those ports)

Pattern: Loaded Coupler with Terminations

% Start with a 4-port coupler
comp = design(couplerRatrace, 5e9);
pcb = pcbComponent(comp);

% Create pcbElement
elem = pcbElement(pcb);

% Ports 1,2 are external I/O (for S-parameter extraction)
elem.AnalysisPorts = {1, 2};

% Ports 3,4 are loaded with lumped elements
elem.PortNumber = {3, 4};
elem.PortValue = {resistor(50), resistor(50)};

% Analyze the 2-port network with internal loads
S = sparameters(elem, linspace(3e9, 7e9, 51), 'SweepOption', 'interp');
rfplot(S);

Pattern: Tunable Filter with Varactors

% Design a filter with extra internal feed points for varactors
pcb = pcbComponent;
% ... build custom filter geometry with internal feed pads ...
% FeedLocations rows 1,2 = external I/O
% FeedLocations rows 3,4 and 5,6 = varactor pads (internal port pairs)

pcb.FeedLocations = [x1 y1 1 3;    % Port 1: input
                     x2 y2 1 3;    % Port 2: output
                     x3 y3 1 3;    % Port 3: varactor pad A+
                     x4 y4 1 3;    % Port 4: varactor pad A-
                     x5 y5 1 3;    % Port 5: varactor pad B+
                     x6 y6 1 3];   % Port 6: varactor pad B-

elem = pcbElement(pcb);
elem.AnalysisPorts = {1, 2};
elem.PortNumber = {{3,4}, {5,6}};
elem.PortValue = {capacitor(2.2e-12), capacitor(2.2e-12)};

S = sparameters(elem, linspace(1e9, 10e9, 51), 'SweepOption', 'interp');
rfplot(S);

Supported PortValue Types

| Type | Example | |------|---------| | resistor | resistor(50) | | capacitor | capacitor(2.2e-12) | | inductor | inductor(1e-9) | | S-parameter file | 'component.s2p' |

PortNumber Formats

% Single-port loads (each port terminated individually)
elem.PortNumber = {3, 4};
elem.PortValue = {resistor(50), resistor(50)};

% Port-pair loads (2-port element connected across a pair)
elem.PortNumber = {{3,4}, {5,6}};
elem.PortValue = {capacitor(2.2e-12), nport('varactor.s2p')};

Antenna Integration

Integrate RF PCB feed networks with Antenna Toolbox arrays.

Corporate Divider + Patch Array

% Design corporate power divider
pdc = powerDividerCorporate;
pdc = design(pdc, 5e9);
pdc.NumOutputPorts = 4;
pdc.PortSpacing = physconst('lightspeed') / 5e9;

% Design patch antenna
ant = patchMicrostripInsetfed;
ant.Substrate = dielectric('Teflon');
ant = design(ant, 5e9);

% Convert to pcbStack for shape extraction
pcbant = pcbStack(ant);
TopLayer = pcbant.Layers{1};

% Create linear array of patches
for i = 2:4
    a = copy(TopLayer);
    a = translate(a, [0, pdc.PortSpacing*(i-1), 0]);
    TopLayer = TopLayer + a;
end

% Merge divider and antenna array into single pcbStack
pcbcomp = pcbComponent(pdc);
pcbant1 = pcbStack;
pcbant1.BoardShape = pcbcomp.BoardShape;
pcbant1.BoardThickness = pcbcomp.BoardThickness;
pcbant1.Layers = pcbcomp.Layers;
pcbant1.FeedDiameter = pcbcomp.FeedDiameter;
pcbant1.FeedLocations = pcbcomp.FeedLocations(1,:);  % Keep only input port

% Combine top layers
pcbant1.Layers{1} = pcbant1.Layers{1} + TopLayer;
show(pcbant1);

pcb2D Cross-Section and Crosstalk

For pcb2D cross-section analysis, trace2D setup, RLGC extraction, slice(), and crosstalk with coupled traces, see matlab-design-pcb-transmission-line.

Exporting S-Parameters to Touchstone Files

Use rfwrite to save computed S-parameters as Touchstone files for reuse in other tools or simulations.

Basic Export

sp = sparameters(pcbComponent, freq, 'SweepOption', 'interp');
rfwrite(sp, 'component.s2p');

rfwrite Options

| Option | Values | Description | |--------|--------|-------------| | FrequencyUnit | 'Hz', 'kHz', 'MHz', 'GHz' | Unit for frequency column | | Parameter | 'S', 'Y', 'Z' | Network parameter type | | Format | 'MA', 'DB', 'RI' | Magnitude-Angle, dB-Angle, Real-Imaginary | | ReferenceResistance | scalar (default 50) | Reference impedance in ohms |

rfwrite(sp, 'filter_2p4GHz.s2p', FrequencyUnit='GHz', Format='DB');

Load Touchstone as nport

n = nport('component.s2p');
% Use in any RF Toolbox circuit
add(ckt, [1 2], n);

The file extension (.s2p, .s4p, etc.) is selected automatically by rfwrite based on port count.

Advanced Integration Patterns

Nolen Matrix Beam-Forming

A Nolen matrix uses cascaded branchline couplers and phase shifters to create an N×N beam-forming network. Build by cascading individual RF PCB components:

coupler = design(couplerBranchline, fc);
ps = design(phaseShifter, fc, PhaseShift=90);
% Extract S-parameters for each, then cascade via circuit()
ckt = circuit;
add(ckt, [1 2 3 4], nport(sparameters(coupler, freq, 'SweepOption', 'interp')));
add(ckt, [3 5], nport(sparameters(ps, freq, 'SweepOption', 'interp')));
% ... build full N×N matrix

Monopulse Comparator

An X-band monopulse comparator uses four ratrace couplers to generate sum and difference beams:

rr = design(couplerRatrace, fc);
S_rr = sparameters(rr, freq, 'SweepOption', 'interp');
% Build 4-coupler comparator network using circuit()

Amplifier Matching Networks

Use microstrip tee junctions and stubs to create input/output matching networks, then cascade with amplifier S-parameters:

% Build matching network as pcbComponent
tee = traceTee(Length=[L1, L2], Width=[W1, W2]);
pcb = pcbComponent(tee);
pcb.Substrate = dielectric("FR4");
S_match = sparameters(pcb, freq, 'SweepOption', 'interp');

% Load amplifier S-parameters and cascade
amp = nport('amplifier.s2p');
ckt = circuit;
add(ckt, [1 2 0 0], nport(S_match));     % 

Truncated for display — read the full file on GitHub.

Related Skills

View on GitHub
GitHub Stars1.1k
CategoryAutomation
Updated18d ago
Forks134

Languages

MATLAB

Trust signals

88/100

From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.

1 medium