SkillAgentSearch skills...

matlab-assemble-pcb-layout

Build custom PCB structures with pcbComponent, shapes, Boolean ops, feeds, and multi-layer stackups for non-catalog geometries.

Install / Use

npx skills add matlab/matlab-agentic-toolkit --skill matlab-assemble-pcb-layout

Installs into whichever agent you are using.

About this skill
📄

SKILL.md

Installable skill definition

Quality Score

93/100

Supported Platforms

Universal

Our assessment of matlab-assemble-pcb-layout

matlab-assemble-pcb-layout scores 93/100 on our quality scale, 236th of 1,199 Content & Media skills we index (top 20%).

Its SKILL.md is 17 KB long, well organised into 43 sections with 30 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-assemble-pcb-layout 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-assemble-pcb-layout compared with similar skills

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

SkillScoreStarsUpdatedFormat
matlab-assemble-pcb-layout (this skill)by matlab931.1k18d agoSKILL.md
Agent-Reachby Panniantong10089.8k18d agoCLAUDE.md
headroomby headroomlabs-ai10074.4ktodayCLAUDE.md
Scraplingby D4Vinci10085.4ktodayMCP Server
crawl4aiby unclecode10084.7k8d agoMCP Server

Frequently asked questions

How do I install matlab-assemble-pcb-layout?
Run npx skills add matlab/matlab-agentic-toolkit --skill matlab-assemble-pcb-layout. The install tabs above show the steps for each supported agent.
Which AI agents does matlab-assemble-pcb-layout 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-assemble-pcb-layout 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-assemble-pcb-layout still maintained?
The repository was last updated 18 days ago, so matlab-assemble-pcb-layout is actively maintained.

name: matlab-assemble-pcb-layout description: "Build 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)." license: https://www.mathworks.com/content/dam/mathworks/license/pmrl/license.md metadata: author: MathWorks version: "1.0"

Assembling Custom PCB Components

When to Use

  • Building custom PCB structures that aren't covered by catalog objects (microstripLine, coupledMicrostripLine, etc.)
  • Constructing multi-layer stackups with custom metal shapes on each layer
  • Combining shape primitives with Boolean operations (union, subtract, intersect)
  • Creating defected ground structures (DGS) by etching patterns into ground planes
  • Placing feed ports, vias, or using advanced FeedDefinitions (coaxial, edge, delta-gap)
  • Assembling stripline or shielded enclosure structures

When NOT to Use

  • Designing standard transmission lines — use matlab-design-pcb-transmission-line
  • Importing layouts from Gerber, ODB++, or Allegro — use matlab-read-pcb-layout
  • Defining dielectric or metal materials — use matlab-manage-pcb-material
  • Running EM analysis after assembly — use matlab-analyze-em
  • Cascading or connecting multiple pcbComponents — use matlab-integrate-pcb-circuit

Typical Workflow

  1. Before: matlab-manage-pcb-material — set up substrate and conductor
  2. This skill: Build the custom PCB structure using pcbComponent, shapes, and feeds
  3. After: matlab-analyze-em — validate S-parameters → matlab-optimize-pcb-design — tune dimensions → matlab-write-pcb-layout — export Gerber

Quick Reference

| Task | Code | |------|------| | Create pcbComponent | pcb = pcbComponent | | Assign layers | pcb.Layers = {signal, substrate, ground} | | Set board shape | pcb.BoardShape = ground | | Set thickness | pcb.BoardThickness = 1.6e-3 | | Place feeds | pcb.FeedLocations = [x1 y1 1 3; x2 y2 1 3] | | Feed diameter | pcb.FeedDiameter = W/2 | | Set conductor | pcb.Conductor = metal("Copper") | | Add vias | pcb.ViaLocations = [x y topLayer botLayer] | | Visualize | show(pcb) | | Layout view | layout(pcb) | | Boolean union | shape = s1 + s2 | | Boolean subtract | shape = s1 - s2 | | Boolean intersect | shape = s1 & s2 |

pcbComponent Anatomy

pcbComponent is the universal container for custom RF PCB structures.

Minimal 2-Layer Microstrip

pcb = pcbComponent;
substrate = dielectric("FR4");
substrate.Thickness = 1.6e-3;

signal = traceRectangular(Length=20e-3, Width=3e-3);
ground = traceRectangular(Length=30e-3, Width=20e-3);

pcb.Layers = {signal, substrate, ground};
pcb.BoardShape = ground;
pcb.BoardThickness = substrate.Thickness;
pcb.Conductor = metal("Copper");
pcb.FeedDiameter = 1.5e-3;
pcb.FeedLocations = [-10e-3 0 1 3; 10e-3 0 1 3];
show(pcb);

5-Layer Stripline Structure

pcb = pcbComponent;
sub = dielectric(Name="FR4", EpsilonR=4.4, LossTangent=0.02, Thickness=0.8e-3);

topGnd = traceRectangular(Length=40e-3, Width=20e-3);
signal = traceRectangular(Length=30e-3, Width=2e-3);
botGnd = traceRectangular(Length=40e-3, Width=20e-3);

pcb.BoardThickness = 2 * sub.Thickness;          % Set BEFORE Layers
pcb.Layers = {topGnd, sub, signal, sub, botGnd};
pcb.BoardShape = topGnd;
pcb.Conductor = metal("Copper");
pcb.FeedLocations = [-15e-3 0 3 1; 15e-3 0 3 5];
pcb.FeedDiameter = 1e-3;
show(pcb);

Key Properties

| Property | Format | Description | |----------|--------|-------------| | Layers | Cell array | Alternating: metal shape, dielectric, metal shape, ... | | BoardShape | Shape object | Outer boundary of the PCB | | BoardThickness | Scalar (m) | Must equal sum of dielectric thicknesses | | FeedLocations | N×4 matrix | [x, y, signalLayer, groundLayer] per port | | FeedDiameter | Scalar (m) | Diameter of feed via/probe | | ViaLocations | M×4 matrix | [x, y, topLayer, bottomLayer] per via | | ViaDiameter | Scalar (m) | Via barrel diameter | | FeedViaModel | String | 'strip', 'square', 'octagon', 'hexagon' | | Conductor | metal object | Conductor for all metal layers | | SolverType | String | 'MoM' or 'FEM' |

Shape Primitives

Rectangular Traces

rect = traceRectangular(Length=20e-3, Width=5e-3, Center=[0 0]);

Line Traces (multi-segment with bends)

tl = traceLine;
tl.Length = [10 5*sqrt(2) 10]*1e-3;
tl.Angle = [0 45 0];
tl.Width = 3e-3;
tl.Corner = 1;          % 1 = Miter, 2 = Smooth (default: Sharp)
show(tl);

Point-Defined Traces

tp = tracePoint;
tp.TracePoints = [0 0; 10e-3 0; 15e-3 5e-3; 25e-3 5e-3];
tp.Width = 2e-3;
tp.Corner = 2;          % 2 = Smooth

Spiral Traces

sp = traceSpiral;
sp.NumTurns = 3;
sp.InnerDiameter = 4e-3;
sp.Spacing = 0.5e-3;
sp.TraceWidth = 0.5e-3;
show(sp);

Tapered Traces

tt = traceTapered;
tt.Length = 10e-3;
tt.InputWidth = 1e-3;
tt.OutputWidth = 3e-3;

Bends

Bend Width is a 2-element vector [w1 w2] for the two arms:

bc = bendCurved;
bc.Width = [2e-3 2e-3];
bc.CurveRadius = 5e-3;

bm = bendMitered;
bm.Width = [2e-3 2e-3];

br = bendRightAngle;
br.Width = [2e-3 2e-3];

U-Bends

U-bend Width is a 3-element vector [arm1 bottom arm2]:

uc = ubendCurved;
uc.Width = [2e-3 2e-3 2e-3];
uc.CurveRadius = 3e-3;

um = ubendMitered;
um.Width = [2e-3 2e-3 2e-3];

Other Shapes

d = delta;
d.OuterRadius = 5e-3;                           % Triangle/delta

db = dumbbell;
db.SideLength = 6e-3;                           % Head size (square Type, default)
db.ArmLength = 10e-3;
db.ArmWidth = 0.5e-3;                           % Dumbbell (for DGS)
% Note: Type='Square' uses SideLength; Type='Circle' uses Diameter

rt = racetrack;
rt.Length = 15e-3;
rt.Width = 5e-3;                                % Racetrack

rd = radial;
rd.OuterRadius = 5e-3;
rd.Angle = 60;                                  % Radial sector

ar = ringAnnular;
ar.InnerRadius = 1e-3;
ar.Width = 4e-3;                                % Annular ring (InnerRadius must be > 0)

sr = splitRing;
sr.RingDiameter = 10e-3;
sr.TraceWidth = 0.5e-3;
sr.SplitGap = 0.5e-3;                           % Split ring resonator

Boolean Operations

Combine shapes using operators to build complex geometries.

Union (+)

left = traceRectangular(Length=10e-3, Width=5e-3, Center=[-5e-3 0]);
right = traceRectangular(Length=10e-3, Width=5e-3, Center=[5e-3 0]);
combined = left + right;
show(combined);

Subtraction (-)

Create slots, gaps, or etched patterns:

base = traceRectangular(Length=20e-3, Width=10e-3);
slot = traceRectangular(Length=15e-3, Width=1e-3);
slotted = base - slot;
show(slotted);

Intersection (&)

ring = ringAnnular;
ring.InnerRadius = 1e-3;
ring.Width = 9e-3;
rect = traceRectangular(Length=15e-3, Width=15e-3);
clipped = ring & rect;

Complex Example: U-CSRR Filter

% Create feeding microstrip
ZA = traceRectangular(Length=4e-3, Width=4e-3, Center=[-7e-3 0]);
Cell = traceRectangular(Length=5e-3, Width=5e-3, Center=[-2.5e-3 0]);
LeftSection = ZA + Cell;

% Create slots using traceLine
s1 = traceLine(StartPoint=[-2.5e-3-0.1e-3, -1.9e-3], ...
    Angle=[-180 -270 0], Length=[1.75e-3 3.8e-3 1.75e-3], Width=0.2e-3);
s2 = traceLine(StartPoint=[-2.5e-3+0.1e-3, -1.9e-3], ...
    Angle=[0 90 180], Length=[1.75e-3 3.8e-3 1.75e-3], Width=0.2e-3);

% Subtract slots from base
LeftSection = LeftSection - s1 - s2;

% Mirror for right section
RightSection = copy(LeftSection);
RightSection = mirrorY(RightSection);

% Complete filter
filter = LeftSection + RightSection;
show(filter);

Feed Placement

FeedLocations Format

Each row: [x, y, signalLayerIndex, groundLayerIndex]

  • Layer indices are odd numbers (1, 3, 5, ...) for metal layers in the Layers cell array
  • Layer 1 = first metal (top), Layer 3 = second metal, etc.
% 2-port microstrip (signal on layer 1, ground on layer 3)
pcb.FeedLocations = [-10e-3 0 1 3;    % Port 1: left edge
                      10e-3 0 1 3];    % Port 2: right edge

4-Port Coupled Trace

pcb.FeedLocations = [0 0 1 3;         % Port 1
                     40e-3 0 1 3;      % Port 2
                     40e-3 -5e-3 1 3;  % Port 3
                     0 -5e-3 1 3];     % Port 4

Feed Diameter

pcb.FeedDiameter = traceWidth / 2;  % Must fit within the trace

Internal Ports (for lumped elements)

Define extra feed locations for internal connections to lumped components (see matlab-integrate-pcb-circuit skill for pcbElement with PortNumber/PortValue).

DGS — Defected Ground Structures

Etch patterns into the ground plane using the dgs method:

ms = microstripLine;
ms.Length = 20e-3;
ms.Width = 3e-3;

% Create a dumbbell DGS under the trace
dgsShape = dumbbell;
dgsShape.SideLength = 4e-3;       % Head size (default Type='Square')
dgsShape.ArmLength = 8e-3;
dgsShape.ArmWidth = 0.5e-3;
ms = dgs(ms, {dgsShape});   % Must capture return value — does not modify in place
show(ms);
memoryEstimate(ms, 10e9, 'RetainMesh', true);  % Check mesh before solving
sp = sparameters(ms, linspace(1e9, 10e9, 51), 'SweepOption', 'interp');
rfplot(sp);

DGS adds bandstop characteristics and can improve coupler directivity or filter rejection.

Shielded Enclosures

Add a conductive lid for shielded analysis:

pcb = pcbComponent;
% ... set up layers ...
pcb.IsShielded = true;   % Adds PEC enclosure walls and lid
show(pcb);

For filter-in-enclosure problems, shielding affects resonant frequencies and coupling.

Shape Manipulation

shape = translate(shape, [dx, dy, 0]);  % Translate
shape = rotateZ(shape, angle);          % Rotate about z-axis (degrees)
shape = rotateX(shape, angle);          % Rotate about x-axis
shape = mirrorX(shape);                 % Mirror about x-axis
shape = mirrorY(shape);                 % Mirror about y-axis
shapeCopy = copy(shape);                % Deep copy
shape = scale(shape, factor);           % Uniform scaling
a = area(shape);                        % Shape area (m²)

For catalog objects, extract shapes by layer with shapes():

s = shapes(obj);              % Struct of shapes by layer name
boardArea = area(s.GroundPlane);

For pcbComponent, shapes are in Layers and BoardShape:

boardArea = area(pcb.BoardShape);

Discovering Available Methods

Use methods(obj) to list all available operations on any object:

methods(pcb)                  % List all pcbComponent methods
methods(traceRectangular)     % List all shape methods

Visualization

show(pcb);          % 3-D structure view
layout(pcb);        % Top-down layout with feeds and vias
mesh(pcb);          % Mesh visualization
info(pcb);          % Print structure summary

Advanced Feed Setup (FeedDefinitions API)

By default, pcbComponent uses FeedLocations (XY coordinates + layer) for simple probe feeds. For advanced feed types — coaxial, edge, delta-gap, finite-gap — switch to the FeedDefinitions API:

pcb = pcbComponent;
pcb.FeedFormat = 'FeedDefinitions';     % Enable FeedDefinitions mode

Feed Types

| Feed Type | Use When | Key Properties | |-----------|----

Truncated for display — read the full file on GitHub.

Related Skills

View on GitHub
GitHub Stars1.1k
CategoryContent
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