Matlab Design Antenna
MathWorksOfficialCreated by MathWorks
- Skill
- Tool integration
- Science and research
- BSD-2-Clause
- No issues found
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
Download the skill as a ZIP:
https://autogineer.com/agent-skills/matlab/matlab-design-antenna/downloadUnzip 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-structuresImpedance matching networks, measuredAntenna, RF propagation, or SAR — use
matlab-integrate-antenna
Must-Follow Rules
Catalog Antennas
Prefer catalog antennas over
customAntenna— usecustomAntennaonly when no catalog antenna or system antenna matches the requested geometryAlways use
design()unless user provides explicit dimensions or antenna lacks design() supportSet substrate BEFORE
design()— design() adapts dimensions to the substrateMesh at lambda/8 for substrate antennas after design() and before analysis
Use
SweepOption="interp"only withsparameters(notimpedance) on substrate antennas
Custom Antennas (customAntenna)
Use
shape.*namespace (NOTantenna.*) withcustomAntennaAll dimensions in meters — not mm or cm
Always define a feed —
customAntennawithoutcreateFeedcannot be analyzedFeed must be at a geometric discontinuity — not middle of flat plate
Extrude first, rotate second —
extrudeLinearrequires XY-plane shapesShapes are handle objects — use
copy()to preserve before transforming
PCB Antennas (pcbStack)
Set
BoardThicknessBEFORELayers— otherwise dielectric gets wrong thicknessUse
antenna.*namespace (NOTshape.*) for pcbStack metal patternsLayer indices are cell array positions — in
{M,D,M}, ground is index 3design()does not work on pcbStack — design catalog antenna first, then convertGerber
Filenamemust be char ('single quotes'), not "string"
Arrays
Always pass element as 3rd argument to
design(arr, freq, element)— omitting resets to dipoleAmplitudeTaperfor rectangularArray is column-major orderInfinite arrays have no NumElements/ElementSpacing — unit cell = ground plane size
Use
phaseShift()for finite steering,ScanAzimuth/ScanElevationfor infinite
AI Workflows
Use
design(..., ForAI=true)— directem.ai.AIAntenna()constructor not supportedOnly 12 antenna types have pretrained AI models
Input slices for
patternFromAImust be row vectors with 1-degree integer spacingAlways validate AI predictions with
exportAntenna+ full-wave simulation
Optimization
Start from
design()to get physically reasonable initial dimensionsTier 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
FrequencyRangeexplicitly for bandwidth optimization (default +/-5% may not match target)
Workflow
1. Catalog Antenna Design
Parse — Identify antenna type, frequency, substrate, constraints
Create — Set substrate (if any), call
design(ant, freq)Mesh —
mesh(ant, MaxEdgeLength=lambda/8)for substrate antennasAnalyze — Impedance, S-parameters, 3D pattern, 2D cuts with
polarpatternReport — Key metrics with units (Z, BW, gain, beamwidth)
2. Custom Antenna Design
Build shapes —
shape.*primitives (Rectangle, Box, Cylinder, Polygon)Transform —
translate,rotate,scale(handle objects — copy first)Combine — Boolean:
+(union),-(subtract),&(intersect)Extrude —
extrudeLinear(taper) orextrudeRotate(revolution)Assemble —
customAntenna(Shape=...),createFeed(ant, loc, numEdges)Mesh & analyze —
mesh(ant, MaxEdgeLength=lambda/6), impedance, pattern
3. PCB Antenna Design
Define stackup —
pcbStack, setBoardThicknessFIRST, thenLayersCreate patterns —
antenna.*shapes with boolean operationsConfigure feed —
FeedLocations = [x, y, sigLayer, gndLayer]Analyze — S-parameters (with
SweepOption="interp"), patternExport —
gerberWritewith PCBWriter, PCBServices, PCBConnectors
4. Array Design
Build array — Set type, size/elements, then
design(arr, freq, element)Steer —
phaseShift()finite,ScanAzimuth/ScanElevationinfiniteTaper —
AmplitudeTaper(column-major for rectangular)Analyze —
arrayFactor(fast) →patternMultiply→pattern(accurate)Coupling —
sparameters,correlation, isolation metrics
5. AI-Accelerated Design
Create —
design(ant, freq, ForAI=true)for supported typesExplore —
tunableRanges, parametric sweep,resonantFrequency,bandwidthValidate —
exportAntenna+ full-wave impedance/patternReconstruct —
patternFromAIfrom 2D slices (row vectors, 1-deg spacing)
6. Optimization
Formulate — Choose objective, design variables, bounds, constraints
Select tier — Catalog + built-in objective → Tier 1; else → Tier 2
Run —
optimize()orOptimizerSADEA/OptimizerTRSADEAExtract —
getBestMemberData,showConvergenceTrend,isConvergedValidate — Full analysis sweep on optimized design
Key Classes
| Class | Purpose |
|---|---|
design() | Scale catalog antennas to frequency |
customAntenna | Arbitrary geometry from shape.* primitives |
pcbStack | Multi-layer PCB antenna with antenna.* shapes |
linearArray / rectangularArray / circularArray | Finite arrays |
conformalArray | Arbitrary element positions (MIMO, custom) |
infiniteArray | Unit cell with Floquet BC |
em.ai.AIAntenna | Pretrained surrogate for instant prediction |
patternFromAI | 3D pattern from 2D slices |
optimize() | Built-in SADEA for catalog antennas |
OptimizerSADEA / OptimizerTRSADEA | Custom optimization |
Conventions
Coding Standards
4-space indentation, lowerCamelCase variables, UpperCamelCase Name-Value args
"double quotes"for strings (except GerberFilenamewhich requires'char')fprintffor formatted outputDo not add titles to Antenna Toolbox plots (
pattern,show,rfplot,impedance)Do add titles to manual
plotfigures andTitleToptopolarpatternShow 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
- ATTRIBUTION.mdAdded by AutoGineer1.0 KiB
- LICENSELicence file added by AutoGineer1.4 KiB
- SKILL.md9.7 KiB
- manifest.yaml714 B
- references/ai-antenna-workflows.md6.6 KiB
- references/arrays.md6.9 KiB
- references/catalog-antennas.md8.9 KiB
- references/custom-antennas.md8.9 KiB
- references/optimization.md8.8 KiB
- references/pcb-antennas.md6.5 KiB
references/catalog-antennas.md
Catalog Antenna Design & Pattern Analysis
Supported Antenna Types
| Category | Types |
|---|---|
| Dipole | dipole, dipoleFolded, dipoleMeander, dipoleVee, dipoleBlade, dipoleCycloid, dipoleCylindrical, dipoleJ, sectorInvertedAmos, bowtieTriangular, bowtieRounded, biquad, rhombic |
| Monopole | monopole, monopoleTopHat, monopoleCylindrical, monopoleRadial, monopoleCustom*, invertedF, invertedL, invertedFcoplanar, invertedLcoplanar |
| Loop | loopCircular, loopRectangular |
| Patch | patchMicrostrip, patchMicrostripCircular, patchMicrostripEnotch, patchMicrostripElliptical, patchMicrostripHnotch, patchMicrostripInsetfed, patchMicrostripTriangular, pifa |
| Slot | slot, vivaldi, vivaldiAntipodal, vivaldiOffsetCavity |
| Spiral | spiralArchimedean, spiralRectangular, spiralEquiangular |
| Helix | helix, helixMultifilar, dipoleHelix, dipoleHelixMultifilar |
| Horn | horn (rectangular), hornConical, hornCorrugated, hornConicalCorrugated, hornPotter, hornScrimp, hornRidge |
| Waveguide | waveguide (rectangular), waveguideCircular, waveguideSlotted, waveguideRidge |
| Cone | bicone, biconeStrip, discone, disconeStrip, monocone |
| Fractal | fractalKoch, fractalIsland, fractalCarpet, fractalSnowflake, fractalGasket |
| Dielectric Resonator | draRectangular, draCylindrical |
| Multi-Element | yagiUda, lpda*, dipoleCrossed, quadCustom |
| Cloverleaf | cloverleaf |
| MRI | birdcage* |
| Custom | customAntenna* |
* Does not support design() — see "Antennas Without design()" below.
Informal Name Mapping
"patch antenna" / "microstrip patch" ->
patchMicrostrip"circular patch" ->
patchMicrostripCircular"inset-fed patch" ->
patchMicrostripInsetfed"Yagi" / "Yagi-Uda" ->
yagiUda"LPDA" / "log-periodic" ->
lpda"horn" / "rectangular horn" ->
horn"conical horn" ->
hornConical"ridged horn" ->
hornRidge"folded dipole" ->
dipoleFolded"meander dipole" / "meander line" ->
dipoleMeander"crossed dipole" ->
dipoleCrossed"J-pole" / "J antenna" ->
dipoleJ"IFA" / "inverted-F" ->
invertedF"ILA" / "inverted-L" ->
invertedL"PIFA" ->
pifa"bowtie" ->
bowtieTriangular"Vivaldi" / "TSA" ->
vivaldi"multifilar helix" ->
helixMultifilar"DRA" ->
draRectangular(ordraCylindricalif cylindrical)"birdcage coil" ->
birdcage
Design Workflow
freq = 2.4e9;
ant = patchMicrostrip;
ant.Substrate = dielectric("FR4"); % set substrate BEFORE design()
ant = design(ant, freq);
figure; show(ant);Antenna Systems (Structures with Exciters)
Structures combine a backing structure with an antenna element via the Exciter property.
Cavity Structures
| Structure | Default Exciter | Substrate | design() |
|---|---|---|---|
cavity | dipole | Yes | Yes |
cavityCircular | dipole | Yes | Yes |
Planar Reflectors
| Structure | Default Exciter | Substrate | design() |
|---|---|---|---|
reflector | dipole | Yes | Yes |
reflectorCircular | dipole | Yes | Yes |
reflectorCorner | dipole | No | Yes |
reflectorGrid | dipole | No | Yes |
reflectorCylindrical | dipole | No | Yes |
Curved Reflectors
| Structure | Default Exciter | design() |
|---|---|---|
reflectorParabolic | dipole | Yes |
reflectorSpherical | dipole | Yes |
cassegrain | hornConical | Yes |
cassegrainOffset | hornConical | Yes |
gregorian | hornConical | Yes |
gregorianOffset | hornConical | Yes |
customDualReflectors | hornConical | No |
System Workflow
ant = cavity;
ant.Exciter = dipole;
ant.Substrate = dielectric("FR4");
ant = design(ant, freq);
ant = reflectorParabolic;
ant.Exciter = helix;
ant = design(ant, freq);Probe Feed (EnableProbeFeed)
ant = cavity;
ant.Substrate = dielectric("FR4");
ant.Exciter = dipole;
ant = design(ant, freq);
ant.EnableProbeFeed = 1;
if ant.Height <= ant.Spacing
ant.Height = ant.Spacing + 0.005;
endAntennas Without design() Support
| Antenna | Fallback |
|---|---|
birdcage | Set properties manually |
customAntenna | Build from shapes (see custom-antennas.md) |
lpda | Set properties manually |
monopoleCustom | Set properties manually |
Substrate Support
Set substrate before calling design():
ant = patchMicrostrip;
ant.Substrate = dielectric("FR4");
ant = design(ant, freq);Elements with Substrate: patchMicrostrip, patchMicrostripCircular, patchMicrostripEnotch, pifa, monopoleTopHat, vivaldiAntipodal, draRectangular, draCylindrical, fractalIsland, fractalCarpet, fractalSnowflake
Built-in materials: "FR4" (er=4.8), "Teflon" (er=2.1), "Air" (er=1.0). Use openDielectricCatalog for more.
Custom substrates:
sub = dielectric(Name="MySubstrate", EpsilonR=2.2, LossTangent=0.0009, Thickness=0.787e-3);
ant.Substrate = sub;Note: design() may adjust substrate Thickness. Always display final properties after design.
Meshing for substrate antennas:
c = physconst("LightSpeed");
lambda = c / freq;
mesh(ant, MaxEdgeLength=lambda/8);S-Parameter Interpolation Sweep
Use SweepOption="interp" only when antenna has a Substrate property:
if isprop(ant, "Substrate") && ~isempty(ant.Substrate)
try
s = sparameters(ant, freqRange, SweepOption="interp");
catch
s = sparameters(ant, freqRange);
end
else
s = sparameters(ant, freqRange);
endSweepOption is only supported by sparameters, not impedance.
Pattern Analysis
3D Radiation Pattern
figure; pattern(ant, freq);2D Cuts with Antenna Metrics
Angle vector sizes: patternAzimuth returns 361 values over -180:1:180. patternElevation also returns 361 values over -180:1:180 (NOT -90:90). Always use -180:1:180 for both.
elCut = 0;
D = patternAzimuth(ant, freq, elCut);
az = -180:1:180; % 361 values — matches patternAzimuth output
figure;
pp = polarpattern(az, D);
pp.AntennaMetrics = true;
pp.TitleTop = sprintf("Azimuth Pattern (El = %g°) at %.2f GHz", elCut, freq/1e9);azCut = 0;
D = patternElevation(ant, freq, azCut);
el = -180:1:180; % 361 values — patternElevation range is -180:180, NOT -90:90
figure;
pp = polarpattern(el, D);
pp.AntennaMetrics = true;
pp.TitleTop = sprintf("Elevation Pattern (Az = %g°) at %.2f GHz", azCut, freq/1e9);Pattern Comparison
D1 = patternAzimuth(ant1, freq, 0);
D2 = patternAzimuth(ant2, freq, 0);
az = -180:1:180;
figure;
pp = polarpattern(az, D1);
add(pp, az, D2);
pp.AntennaMetrics = true;
pp.LegendLabels = {'Antenna 1', 'Antenna 2'}; % cell array of char vectorsMulti-Frequency Pattern
freqs = [freq1, freq2, freq3];
az = -180:1:180;
D1 = patternAzimuth(ant, freqs(1), 0);
figure;
pp = polarpattern(az, D1);
for i = 2:numel(freqs)
D = patternAzimuth(ant, freqs(i), 0);
add(pp, az, D);
end
pp.AntennaMetrics = true;
pp.LegendLabels = arrayfun(@(f) sprintf('%.2f GHz', f/1e9), freqs, UniformOutput=false);Polarization Analysis
% Axial ratio (for CP antennas: helix, spiral, cloverleaf)
figure; axialRatio(ant, freq, 0, 0:1:360);
% Polarization-specific pattern
figure; pattern(ant, freq, Type="directivity", Polarization="RHCP");
% Available: "combined", "LHCP", "RHCP", "H", "V"Key Metric Functions
bw = beamwidth(ant, freq, azimuthAngle, elevationAngles);
[peakVal, peakAz, peakEl] = peakRadiation(ant, freq);polarpattern Properties
| Property | Description | Values |
|---|---|---|
AntennaMetrics | Show beamwidth, sidelobes, F/B ratio | true/false |
Peaks | Number of peak markers | integer |
LegendLabels | Labels for overlaid datasets | cell array of char vectors |
AngleLim | Angle range displayed | [min max] |
MagnitudeLim | Magnitude axis limits | [min max] |
NormalizeData | Normalize to peak | true/false |
Analysis Template
% TEMPLATE — not executable (replace <design_frequency> with actual value)
freq = <design_frequency>;
bw = 0.2 * freq;
freqRange = linspace(freq - bw/2, freq + bw/2, 51);
figure; impedance(ant, freqRange);
if isprop(ant, "Substrate") && ~isempty(ant.Substrate)
try s = sparameters(ant, freqRange, SweepOption="interp");
catch, s = sparameters(ant, freqRange); end
else
s = sparameters(ant, freqRange);
end
figure; rfplot(s);
figure; pattern(ant, freq);
Z = impedance(ant, freq);
fprintf("Impedance: %.2f + j%.2f ohm\n", real(Z), imag(Z));Frequency Interpretation
Parse units: MHz, GHz, Hz. Default to Hz if no unit given.
For band names ("ISM band", "S-band"), use the standard center frequency.
Supported range: 10 kHz to 200 GHz.
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 or MathWorks.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download matlab-design-antenna.zip