Atlas / Skills / matlab / Matlab Write Pcb Layout

Matlab Write Pcb LayoutSAFE

skills/matlab/matlab-write-pcb-layout

The MATLAB Agentic Toolkit brings proven MATLAB capabilities to AI agents, making engineering and scientific workflows agent-ready.

Verdict
SAFE
Grade
B
Trust score
89 /100
Version
1.0
Hosts
—
License
NOASSERTION
Stars
1,164
01

Overview

The MATLAB Agentic Toolkit brings proven MATLAB capabilities to AI agents, making engineering and scientific workflows agent-ready.

Read from source at commit 58967e6f32b5OBSERVED · 2026-10-14
02

What it tells the agent

The instruction file, verbatim from the audited commit — this is the text the model reads, and the surface the audit's instruction layer examines. Quoted here so you can judge it without cloning anything.

---
name: matlab-write-pcb-layout
description: "Export pcbComponent designs to Gerber files with RF connectors and fab service formatting for PCB manufacturing. TRIGGER: user asks to export a PCB design to Gerber, generate manufacturing files, or write out a pcbComponent for fabrication. Invoke BEFORE writing export code — gerberWrite signature (pcbComponent, connectors, filename) is non-obvious. SKIP: importing/reading PCB files (use matlab-read-pcb-layout), building PCB geometry (use matlab-assemble-pcb-layout), EM analysis (use matlab-analyze-em), material/stackup setup (use matlab-manage-pcb-material)."
license: https://www.mathworks.com/content/dam/mathworks/license/pmrl/license.md
metadata:
  author: MathWorks
  version: "1.0"
---

# Writing PCB Layouts to Manufacturing Files

## When to Use

- Exporting a pcbComponent or pcbStack design to Gerber manufacturing files
- Selecting and configuring RF connectors (SMA, SMB, MMCX, etc.) for PCB export
- Formatting output for specific fabrication services (OSH Park, Seeed, Advanced Circuits)
- Attaching RFConnector objects to catalog components for shielded analysis
- Generating a complete manufacturing package from a MATLAB RF design

## When NOT to Use

- Importing Gerber files into MATLAB — use `matlab-read-pcb-layout`
- Building the PCB design itself — use `matlab-assemble-pcb-layout` or the designing skills
- Running EM analysis — use `matlab-analyze-em`

## Typical Workflow

1. **Before:** A design skill or `matlab-assemble-pcb-layout` — create the pcbComponent; `matlab-analyze-em` — validate performance; `matlab-optimize-pcb-design` — tune if needed
2. **This skill:** Export to Gerber with connectors and fab formatting

## Quick Reference

| Task | Code |
|------|------|
| Export Gerber files | `[A,g] = gerberWrite(pcb, W, {C1,C2})` |
| SMA connector | `C = PCBConnectors.SMA_Cinch` |
| Edge-launch SMA | `C = PCBConnectors.SMAEdge_Samtec` |
| PCB service writer | `W = PCBServices.OSHParkWriter` |
| Customize writer | `W.Filename = 'name'; W.CoordUnits = 'mm'` |
| RF connector object | `rc = RFConnector` |
| Design connector for PCB | `rc = design(RFConnector, pcb)` |

## gerberWrite — Export to Manufacturing

The `gerberWrite` function generates manufacturing files from a `pcbComponent`.

### Basic Export

```matlab
p = pcbComponent;   % Your designed component
W = PCBServices.OSHParkWriter;
W.Filename = 'my_design';          % Controls output zip/folder name (default: 'untitled')
C1 = PCBConnectors.SMA_Cinch;
C2 = PCBConnectors.SMA_Cinch;

[A, outputPath] = gerberWrite(p, W, {C1, C2});
```

### Output

`gerberWrite` produces a folder of Gerber and drill files:
- Top/bottom copper layers
- Solder mask layers
- Silkscreen layers
- Drill files
- Board outline

The `A` output is a `PCBWriter` object with export metadata. `outputPath` is the path to the generated files.

## PCBWriter Object

The `PCBWriter` object controls export settings.

### Properties

| Property | Description |
|----------|-------------|
| `Design` | Struct containing the PCB design data |
| `Writer` | The PCB service writer (output format) |
| `Connector` | Cell array of connector objects |
| `UseDefaultConnector` | Use default connector if none specified |
| `ComponentBoundaryLineWidth` | Outline line width |
| `PCBMargin` | Extra board margin around component (m) |
| `Soldermask` | `'both'`, `'top'`, `'bottom'`, or `'none'` |
| `Solderpaste` | Logical — generate solderpaste layer |
| `Font` | Font for text on silkscreen |

## PCBConnectors — Connector Catalog

Attach standard RF connectors to your exported board.

### Available Connectors (25 Built-in Types)

| Category | Connectors |
|----------|-----------|
| **SMA 5-Pad** | `SMA`, `SMA_Cinch`, `SMA_Multicomp` |
| **SMA Edge-Launch** | `SMAEdge`, `SMAEdge_Cinch`, `SMAEdge_Samtec`, `SMAEdge_Amphenol`, `SMAEdge_Linx` |
| **SMB/SMC** | `SMB_Johnson`, `SMB_Pasternack`, `SMC_Pasternack`, `SMCEdge_Pasternack` |
| **MMCX** | `MMCX_Cinch`, `MMCX_Samtec` |
| **IPX/U.FL** | `IPX_Jack_Lighthorse`, `IPX_Plug_Lighthorse`, `UFL_Hirose` |
| **Coaxial Cable** | `Coax_RG11`, `Coax_RG58`, `Coax_RG59`, `Coax_RG174` |
| **Semi-Rigid** | `Semi_020`, `Semi_034`, `Semi_047`, `Semi_118` |

Access via `PCBConnectors.<type>`. All connectors have common properties: `Type`, `Mfg`, `Part`, `Annotation`, `Impedance` (default: 50 ohm), `Datasheet`, `Purchase`.

5-pad properties: `TotalSize`, `GroundPadSize`, `SignalPadDiameter`, `PinHoleDiameter`, `IsolationRing`, `VerticalGroundStrips`

Edge-launch properties: `GroundPadSize`, `GroundSeparation`, `GroundPadIsolation`, `SignalPadSize`, `SignalGap`, `SignalLineWidth`, `EdgeLocation` (`'north'|'south'|'east'|'west'`), `ExtendBoardProfile`, `FillGroundSide`

Coax properties: `PinDiameter`, `DielectricDiameter`, `ShieldDiameter`, `AddThermals`, `ThermalsDiameter`, `ThermalsBridgeWidth`

Connectors are placed at feed locations during Gerber export. They define pad footprints and drill patterns.

## PCBServices — Fabrication Service Writers

Writers configure output for specific fabrication services.

### Available Services (5 Built-in Writers)

| Service | Description |
|---------|-------------|
| `PCBServices.GerbLookWriter` | GerbLook online viewer |
| `PCBServices.ZofZWriter` | ZofZ 3-D Gerber viewer |
| `PCBServices.AdvancedCircuitsWriter` | Advanced Circuits manufacturing |
| `PCBServices.SeeedWriter` | Seeed Studio manufacturing |
| `PCBServices.OSHParkWriter` | OSH Park manufacturing |

Each writer formats Gerber files according to the fab house's naming and layer conventions.

**Key PCBServices properties:** `Filename`, `CoordUnits` (`'in'`/`'mm'`), `CoordPrecision`, `CreateArchiveFile`, `DefaultViaDiameter`, `UseExcellon`, `BoardProfileFile`, `SameExtensionForGerberFiles`, `PostWriteFcn`, `Files`

```matlab
% Customize a service writer
w = PCBServices.AdvancedCircuitsWriter;
w.Filename = 'my_antenna';
w.CoordUnits = 'mm';
w.CoordPrecision = [3 4];
```

## RF Connectors

`RFConnector` mo
03

Trust audit

SAFEgrade B · trust 89/100 Nothing in the source contradicts what it says it does. Grade A is reserved for packages that have also passed the behavioural sandbox.

LayerWhat it checksResult
L0Provenance & inventoryPASS
L1Static analysis of the codeNA
L2Instruction surface (what it tells the agent)PASS
L3Class-specific surfacePASS
L4Behavioural (sandbox)SKIPPED

What the source does

Filesystem
none-observed
Network
none-observed
Shell
none-observed
Dependencies
pinned
Secrets in source
none-found

Findings (0)

No findings outside the package's declared scope.

Gates applied: no_behavioural_pass.

Audited 2026-10-14 · audit v0.4.1 · source sha 58967e6f32b5full audit observations/trust-audit/skill/matlab__matlab-write-pcb-layout.json · Report an issue / request a re-scan
04

Audit history

Every audit this skill has had.

DateSourceVerdictGradeScoreChange
2026-10-1458967e6f32b5SAFEB89first audit
05

Questions

What does the Matlab Write Pcb Layout skill do?

The MATLAB Agentic Toolkit brings proven MATLAB capabilities to AI agents, making engineering and scientific workflows agent-ready.

Is Matlab Write Pcb Layout safe to install?

The audit found nothing in the source that contradicts what it says it does, and graded it B (89/100). Grade A is held back for packages that have also passed a sandboxed behavioural run, which is why a clean skill reads B.

What can Matlab Write Pcb Layout access on my machine?

The audit observed no filesystem, network or shell use at all in its source.

How current is this page?

The grade is for one exact copy of the source (58967e6f32b5), read on 2026-10-14. The repository is watched, and a new audit runs when it changes — this is the first audit.

Advertisement