Generated banner for Matlab Design Antenna
Generated logo for Matlab Design Antenna

Matlab Design Antenna

MathWorksOfficialCreated by MathWorks

  • Skill
  • Tool integration
  • Science and research
  • BSD-2-Clause
  • No issues found

From the author

Design 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.
— the description by MathWorks

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

This skill provides a comprehensive framework for antenna engineering within the MATLAB environment. It covers the full lifecycle of antenna development, including catalog-based design, custom geometry construction, multi-layer PCB stackups, and complex array configurations. The skill integrates advanced capabilities such as AI-accelerated design exploration using surrogate models and automated optimization routines (SADEA/TR-SADEA) to refine performance metrics like gain, bandwidth, and sidelobe levels. It is intended for engineers performing electromagnetic modeling, analysis, and fabrication preparation.

What it does

  • Automates the design of standard catalog antennas based on frequency and substrate requirements.
  • Enables construction of custom 3D antenna geometries using geometric primitives and boolean operations.
  • Supports multi-layer PCB antenna stackup design with Gerber file export for fabrication.
  • Models finite and infinite antenna arrays with support for beam steering and amplitude tapering.
  • Accelerates design space exploration using pretrained AI surrogate models.
  • Performs geometric and performance optimization using surrogate-assisted algorithms.

When to use it

  • When you need to design a standard antenna element at a specific operating frequency.
  • When creating custom antenna structures or complex multi-layer PCB antenna designs.
  • When analyzing array performance, including mutual coupling, beam steering, and scan blindness.
  • When you need to optimize antenna dimensions to meet specific gain or bandwidth targets.
  • When performing rapid parametric sweeps using AI-accelerated surrogate models.

Advantages

  • Seamless integration with MATLAB's computational and visualization environment.
  • Reduces simulation time for design exploration via AI surrogate models.
  • Provides built-in optimization routines specifically tuned for antenna performance metrics.
  • Supports industry-standard fabrication outputs like Gerber files for PCB antennas.
  • Handles complex array analysis including infinite array Floquet boundary conditions.

Usage examples

“Design a patch antenna for 2.4 GHz on an FR4 substrate.”
The agent will set the substrate to FR4, instantiate a patchMicrostrip antenna, apply the design() function for the 2.4 GHz frequency, and provide the resulting dimensions.
“Create a 4x4 rectangular array of dipoles at 5 GHz.”
The agent will configure a rectangularArray, set the size to [4, 4], and use design() with a dipole element to calculate the appropriate spacing and dimensions for 5 GHz.
“Optimize the length and width of a patch antenna for maximum gain.”
The agent will set up an optimization routine using the optimize() function, defining the patch dimensions as variables and gain as the objective function.
“How do I build a custom antenna using a cylinder and a box?”
The agent will guide you to use the shape.* namespace to define the primitives, apply boolean operations to combine them, and use customAntenna to assemble the final structure with a feed.

Install

  1. Download the skill as a ZIP:

    https://mp-staging.autogineer.com/agent-skills/matlab/matlab-design-antenna/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip matlab-design-antenna.zip -d .agents/skills

Documentation by MathWorks

Antenna and Array Design

Design, analyze, and optimize antennas and arrays using MATLAB Antenna Toolbox — from catalog elements to custom shapes, PCB fabrication, AI-accelerated exploration, and surrogate-assisted optimization.

When to Use

Catalog antenna design

  • Design a standard antenna at a frequency (dipole, patch, horn, helix, Yagi, etc.)

  • Analyze radiation pattern (3D, 2D cuts, polarization, beamwidth, sidelobes)

  • Compute impedance, S-parameters, or return loss

  • Set substrate material before design

  • Compare patterns across antennas or frequencies

Custom antenna design

  • Build non-catalog antennas from geometric primitives (shape.*)

  • Construct 3D structures (waveguides, horns, cavities) via extrusion

  • Import STL/CAD geometry and add feeds

  • Configure delta-gap or probe feeds on custom structures

PCB antenna design

  • Build multi-layer PCB antenna stackups (pcbStack)

  • Create custom metal patterns with boolean operations (antenna.*)

  • Configure probe, edge, or aperture-coupled feeds

  • Export Gerber files for fabrication

  • Convert catalog antennas to pcbStack

Array design

  • Design linear, rectangular, circular, or conformal arrays

  • Beam steering, amplitude tapering, grating lobe analysis

  • Infinite array analysis (scan impedance, scan blindness, Floquet BC)

  • MIMO/handset multi-antenna isolation and ECC

  • Mutual coupling analysis

AI-accelerated design

  • Rapid parametric sweeps with AIAntenna surrogate models

  • Reconstruct 3D patterns from 2D slices (patternFromAI)

  • Full-factorial design space exploration

  • Export AI-tuned designs for full-wave validation

Optimization

  • Optimize antenna dimensions for gain, bandwidth, SLL, or F/B ratio

  • Built-in optimize() for catalog antennas with string objectives

  • SADEA/TR-SADEA with custom evaluation functions for pcbStack/customAntenna

  • Geometric constraints (linear and nonlinear)

When NOT to Use

  • Reflector antennas, reflectarrays, installed antennas, or RCS — use matlab-analyze-antenna-structures

  • Impedance matching networks, measuredAntenna, RF propagation, or SAR — use matlab-integrate-antenna

Must-Follow Rules

Catalog Antennas
  • Prefer catalog antennas over customAntenna — use customAntenna only when no catalog antenna or system antenna matches the requested geometry

  • Always use design() unless user provides explicit dimensions or antenna lacks design() support

  • Set substrate BEFORE design() — design() adapts dimensions to the substrate

  • Mesh at lambda/8 for substrate antennas after design() and before analysis

  • Use SweepOption="interp" only with sparameters (not impedance) on substrate antennas

Custom Antennas (customAntenna)
  • Use shape.* namespace (NOT antenna.*) with customAntenna

  • All dimensions in meters — not mm or cm

  • Always define a feed — customAntenna without createFeed cannot be analyzed

  • Feed must be at a geometric discontinuity — not middle of flat plate

  • Extrude first, rotate second — extrudeLinear requires XY-plane shapes

  • Shapes are handle objects — use copy() to preserve before transforming

PCB Antennas (pcbStack)
  • Set BoardThickness BEFORE Layers — otherwise dielectric gets wrong thickness

  • Use antenna.* namespace (NOT shape.*) for pcbStack metal patterns

  • Layer indices are cell array positions — in {M,D,M}, ground is index 3

  • design() does not work on pcbStack — design catalog antenna first, then convert

  • Gerber Filename must be char ('single quotes'), not "string"

Arrays
  • Always pass element as 3rd argument to design(arr, freq, element) — omitting resets to dipole

  • AmplitudeTaper for rectangularArray is column-major order

  • Infinite arrays have no NumElements/ElementSpacing — unit cell = ground plane size

  • Use phaseShift() for finite steering, ScanAzimuth/ScanElevation for infinite

AI Workflows
  • Use design(..., ForAI=true) — direct em.ai.AIAntenna() constructor not supported

  • Only 12 antenna types have pretrained AI models

  • Input slices for patternFromAI must be row vectors with 1-degree integer spacing

  • Always validate AI predictions with exportAntenna + full-wave simulation

Optimization
  • Start from design() to get physically reasonable initial dimensions

  • Tier 1 bounds: cell array {lb1,lb2; ub1,ub2}, Tier 2 bounds: numeric matrix [lb;ub]

  • Negate metrics for maximization in custom evaluation functions (SADEA minimizes)

  • Wrap custom eval in try/catch — return 1e6 penalty for invalid geometry

  • Set FrequencyRange explicitly for bandwidth optimization (default +/-5% may not match target)

Workflow

1. Catalog Antenna Design
  1. Parse — Identify antenna type, frequency, substrate, constraints

  2. Create — Set substrate (if any), call design(ant, freq)

  3. Mesh — mesh(ant, MaxEdgeLength=lambda/8) for substrate antennas

  4. Analyze — Impedance, S-parameters, 3D pattern, 2D cuts with polarpattern

  5. Report — Key metrics with units (Z, BW, gain, beamwidth)

2. Custom Antenna Design
  1. Build shapes — shape.* primitives (Rectangle, Box, Cylinder, Polygon)

  2. Transform — translate, rotate, scale (handle objects — copy first)

  3. Combine — Boolean: + (union), - (subtract), & (intersect)

  4. Extrude — extrudeLinear (taper) or extrudeRotate (revolution)

  5. Assemble — customAntenna(Shape=...), createFeed(ant, loc, numEdges)

  6. Mesh & analyze — mesh(ant, MaxEdgeLength=lambda/6), impedance, pattern

3. PCB Antenna Design
  1. Define stackup — pcbStack, set BoardThickness FIRST, then Layers

  2. Create patterns — antenna.* shapes with boolean operations

  3. Configure feed — FeedLocations = [x, y, sigLayer, gndLayer]

  4. Analyze — S-parameters (with SweepOption="interp"), pattern

  5. Export — gerberWrite with PCBWriter, PCBServices, PCBConnectors

4. Array Design
  1. Build array — Set type, size/elements, then design(arr, freq, element)

  2. Steer — phaseShift() finite, ScanAzimuth/ScanElevation infinite

  3. Taper — AmplitudeTaper (column-major for rectangular)

  4. Analyze — arrayFactor (fast) → patternMultiply → pattern (accurate)

  5. Coupling — sparameters, correlation, isolation metrics

5. AI-Accelerated Design
  1. Create — design(ant, freq, ForAI=true) for supported types

  2. Explore — tunableRanges, parametric sweep, resonantFrequency, bandwidth

  3. Validate — exportAntenna + full-wave impedance/pattern

  4. Reconstruct — patternFromAI from 2D slices (row vectors, 1-deg spacing)

6. Optimization
  1. Formulate — Choose objective, design variables, bounds, constraints

  2. Select tier — Catalog + built-in objective → Tier 1; else → Tier 2

  3. Run — optimize() or OptimizerSADEA/OptimizerTRSADEA

  4. Extract — getBestMemberData, showConvergenceTrend, isConverged

  5. Validate — Full analysis sweep on optimized design

Key Classes

ClassPurpose
design()Scale catalog antennas to frequency
customAntennaArbitrary geometry from shape.* primitives
pcbStackMulti-layer PCB antenna with antenna.* shapes
linearArray / rectangularArray / circularArrayFinite arrays
conformalArrayArbitrary element positions (MIMO, custom)
infiniteArrayUnit cell with Floquet BC
em.ai.AIAntennaPretrained surrogate for instant prediction
patternFromAI3D pattern from 2D slices
optimize()Built-in SADEA for catalog antennas
OptimizerSADEA / OptimizerTRSADEACustom optimization

Conventions

Coding Standards
  • 4-space indentation, lowerCamelCase variables, UpperCamelCase Name-Value args

  • "double quotes" for strings (except Gerber Filename which requires 'char')

  • fprintf for formatted output

  • Do not add titles to Antenna Toolbox plots (pattern, show, rfplot, impedance)

  • Do add titles to manual plot figures and TitleTop to polarpattern

  • Show all plots in separate figures. Include units in all output.

  • Use physconst("LightSpeed") — never hardcode 3e8

Script-First Workflow

For design, analysis, or sweep tasks — write code to .m files, run via run_matlab_file, iterate by editing and re-running. Use inline evaluate_matlab_code for quick one-off checks.

References
Load when...Reference
Designing catalog antennas (types, design(), substrate, patterns)references/catalog-antennas.md
Building custom antennas (shape.*, extrusion, feeds, substrate)references/custom-antennas.md
Designing PCB antennas (pcbStack, layers, boolean, Gerber)references/pcb-antennas.md
Designing arrays (finite, infinite, steering, taper, MIMO)references/arrays.md
AI design exploration (AIAntenna, patternFromAI, surrogates)references/ai-antenna-workflows.md
Optimizing antennas (SADEA, bounds, constraints, custom eval)references/optimization.md

Copyright 2026 The MathWorks, Inc.

Files

references/pcb-antennas.md

PCB Antenna Design (pcbStack)

Layer Stack Construction

The Layers property is a cell array specified top-to-bottom, alternating metal shapes and dielectric objects.

Critical Rules
  1. Set BoardThickness BEFORE Layers — Setting Layers always overwrites dielectric thickness with current BoardThickness. Setting BoardThickness afterwards does NOT fix it.

  2. Layer indices are cell array positions — In {metal, diel, metal}, metals are at indices 1 and 3.

  3. First and last entries are typically metal — but dielectric layers can appear first/last (e.g., radome above top patch).

  4. BoardThickness = total dielectric below top metal — For multi-substrate stacks, sum all dielectric thicknesses.

3-Layer Stack (Most Common)
subHeight = 1.6e-3;
sub = dielectric("FR4");

p = pcbStack;
p.BoardShape = antenna.Rectangle(Length=60e-3, Width=60e-3);
p.BoardThickness = subHeight;       % MUST be set BEFORE Layers
p.Layers = {patch, sub, ground};    % {metal(1), diel(2), metal(3)}
p.FeedLocations = [x, y, 1, 3];    % sig=1(top), gnd=3(bottom)
2-Layer Stack (Air Dielectric)
p.Layers = {radiator, ground};      % air dielectric assumed
p.FeedLocations = [x, y, 1, 2];
5-Layer Stack (Aperture-Coupled)
p.BoardThickness = upperSubHeight + lowerSubHeight;
p.Layers = {radiator, upperSub, slottedGround, lowerSub, feedLine};
p.FeedLocations = [x, y, 5, 3];    % sig=5(feedLine), gnd=3(ground)
Substrate Materials
MaterialEpsilonRLossTangentUse Case
"FR4"4.80.026Prototyping
Custom "RO4003C"3.550.0027High-frequency
"Teflon"2.10.0002Very low loss
sub = dielectric(Name="RO4003C", EpsilonR=3.55, LossTangent=0.0027, Thickness=h);

Shape Operations (antenna.* Namespace)

Available Shapes
ShapeKey Properties
antenna.RectangleLength, Width, Center, NumPoints
antenna.CircleRadius, Center, NumPoints
antenna.EllipseMajorAxis, MinorAxis, Center
antenna.PolygonVertices (N-by-3)
antenna.TriangleInputType, Side, Angle
Boolean Operations
patchWithFeed = patch + feedLine;        % union
gndWithSlot = ground - slot;             % subtraction
eNotch = patch - notch1 - notch2;
Common Patterns
% Slot in ground
slot = antenna.Rectangle(Length=30e-3, Width=2e-3);
slottedGround = gnd - slot;

% Ring patch
ring = antenna.Circle(Radius=15e-3) - antenna.Circle(Radius=10e-3);

% Corner-truncated patch for CP
tri1 = antenna.Polygon(Vertices=[Lp/2, Lp/2, 0; Lp/2-tc, Lp/2, 0; Lp/2, Lp/2-tc, 0]);
tri2 = antenna.Polygon(Vertices=[-Lp/2, -Lp/2, 0; -Lp/2+tc, -Lp/2, 0; -Lp/2, -Lp/2+tc, 0]);
cpPatch = patch - tri1 - tri2;
Geometric Transforms
shifted = translate(shape, [dx, dy, 0]);
rotated = rotateZ(shape, angleDeg);
mirrored = mirrorX(copy(shape));
shapeCopy = copy(shape);
bigger = scale(shape, factor);

Feed Configuration

Delta-Gap Feed Model

Feed offset from patch center controls impedance:

  • Center: ~0 ohm (current antinode)

  • Edge: ~200+ ohm (current node)

  • ~1/4 to 1/3 from center: ~50 ohm

Unbalanced Feed (Most Common)

Format: [x, y, sigLayer, gndLayer] — 4 columns.

% For 3-layer stack {metal, diel, metal}: sig=1 (top), gnd=3 (bottom)
% For 2-layer stack {metal, metal}: use gnd=2 instead of 3
p.FeedLocations = [patchL/4, 0, 1, 3];
p.FeedDiameter = 1e-3;
Edge Feed
p.FeedLocations = [0, -30e-3, 1, 3];   % south edge of 60x60 board
Multi-Feed (Dual Polarization / CP)
p.FeedLocations = [7e-3, 0, 1, 3;
                   0, 9e-3, 1, 3];
p.FeedVoltage = [1, 1];
p.FeedPhase = [0, 90];
Balanced Feed

Format: [x, y, layer] — 3 columns.

p.FeedLocations = [0, 0, 1];
FeedViaModel
ModelSidesWhen to Use
"strip"2Default, fast
"square"4Better probe modeling
"hexagon"6More accurate
"octagon"8Most accurate

Via Configuration

Format: [x, y, sigLayer, gndLayer].

p.ViaLocations = [25e-3, 25e-3, 1, 3;
                  25e-3, -25e-3, 1, 3;
                  -25e-3, 25e-3, 1, 3;
                  -25e-3, -25e-3, 1, 3];
p.ViaDiameter = 0.8e-3;
Via Fencing
nVias = 20;
theta = linspace(0, 2*pi, nVias+1); theta = theta(1:end-1);
viaRadius = 28e-3;
vx = viaRadius * cos(theta);
vy = viaRadius * sin(theta);
p.ViaLocations = [vx(:), vy(:), ones(nVias,1), 3*ones(nVias,1)];
p.ViaDiameter = 0.5e-3;

Conductor Material

p.Conductor = metal("Copper");

Available: PEC, Copper, Aluminium, Gold, Silver.

Analysis

freq = 2.4e9;
freqRange = linspace(2e9, 3e9, 21);

Z = impedance(p, freq);
try s = sparameters(p, freqRange, SweepOption="interp");
catch, s = sparameters(p, freqRange); end
figure; rfplot(s);
figure; pattern(p, freq);

% Pattern types
pattern(p, freq, Type="directivity");
pattern(p, freq, Type="gain");
pattern(p, freq, Type="realizedgain");
Mesh Control
mesh(p, MaxEdgeLength=lambda/15);
mem = memoryEstimate(p, freq);

% Fine features near large areas
mesh(p, MaxEdgeLength=0.01, MinEdgeLength=0.001, GrowthRate=0.7);

Catalog Antenna Conversion

ant = design(patchMicrostrip, 2.4e9);
pb = pcbStack(ant);
pb.Conductor = metal("Copper");
pb.FeedDiameter = 1.27e-3;

design() does not work directly on pcbStack. Design catalog antenna first, then convert.

Gerber Export

Basic Export
[A, g] = gerberWrite(p);

Requires at least one dielectric layer in Layers.

With Connector and Service
W = PCBServices.OSHParkWriter;
W.Filename = 'my_antenna';        % MUST be char, not "string"

C = PCBConnectors.SMA_Cinch;
A = PCBWriter(p, W, C);
gerberWrite(A);
Edge-Launch Connector
C = PCBConnectors.SMAEdge_Samtec;
C.EdgeLocation = 'south';
C.ExtendBoardProfile = true;
p.FeedLocations = [0, -boardW/2, 1, 3];
Available Connectors
TypeExamples
Through-hole SMASMA_Cinch, SMA_Multicomp
Edge-launch SMASMAEdge_Samtec, SMAEdge_Amphenol
CoaxialCoax_RG58, Coax_RG174
U.FL / IPXUFL_Hirose, IPX_Jack_LightHorse
MMCXMMCX_Cinch, MMCX_Samtec
Available Services

OSHParkWriter, PCBWayWriter, SeeedWriter, MayhewWriter, EuroCircuitsWriter, AdvancedCircuitsWriter.


Copyright 2026 The MathWorks, Inc.

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Security

No issues found by our static scan· No issues found

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Created by
MathWorks
Publisher
MathWorks (Official)
Source
matlab/matlab-agentic-toolkit · skills-catalog/rf-and-mixed-signal/matlab-design-antenna · commit 2a7f215
Licence
BSD 2-Clause License (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE.md)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by MathWorks.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download matlab-design-antenna.zip