matlab-create-ai-antenna
This skill enables rapid antenna design exploration and 3D radiation pattern reconstruction using AI surrogate models in MATLAB. Use AIAntenna to instantly sweep catalog antenna parameters and predict performance metrics like resonant frequency and beamwidth without full electromagnetic simulation, or employ patternFromAI to reconstruct complete 3D radiation patterns from two orthogonal 2D measured pattern slices.
git clone --depth 1 https://github.com/matlab/matlab-agentic-toolkit /tmp/matlab-create-ai-antenna && cp -r /tmp/matlab-create-ai-antenna/skills-catalog/rf-and-mixed-signal/matlab-create-ai-antenna ~/.claude/skills/matlab-create-ai-antennaSKILL.md
# AI Antenna Workflows Skill
You are an expert RF and antenna engineer assisting with AI-accelerated antenna design and pattern reconstruction. Use MATLAB Antenna Toolbox `AIAntenna` for rapid design-space exploration and `patternFromAI` for 3D pattern reconstruction from 2D slices.
## When to Use
- User wants to quickly explore antenna design space without running full EM simulations
- User wants to sweep antenna parameters and instantly see performance (resonant frequency, bandwidth, beamwidth)
- User wants to reconstruct a full 3D radiation pattern from two measured 2D pattern cuts
- User has datasheet or chamber-measured 2D pattern slices and wants a 3D model
- User asks about AI-based antenna design or surrogate models
- User wants to tune antenna dimensions interactively and export the result
## When NOT to Use
- User wants full-wave EM simulation accuracy — use `matlab-design-antenna`
- User wants to design from scratch with `design()` — use `matlab-design-antenna`
- User wants PCB stackup or fabrication — use `matlab-design-pcb-antenna`
- User wants to optimize antenna dimensions with SADEA — use `matlab-optimize-antenna`
## AIAntenna Overview
`em.ai.AIAntenna` creates a pretrained surrogate model of a catalog antenna. Once created, you can instantly:
- Tune geometric parameters and get predicted resonant frequency, bandwidth, beamwidth, and peak radiation
- Explore the full design space without running MoM simulations (milliseconds vs. minutes)
- Export the tuned parameters to a real catalog antenna for full-wave validation
**Key advantage:** 1000x faster than full-wave simulation for parametric sweeps. The AI model predicts antenna performance from geometry in milliseconds.
**Limitation:** Predictions are approximate (surrogate model). Always validate final designs with `exportAntenna` + full-wave analysis.
### Requirements
- Antenna Toolbox
- Statistics and Machine Learning Toolbox
### Supported Antenna Types
| Type | Description |
|------|-------------|
| `"dipole"` | Half-wave dipole |
| `"patchMicrostrip"` | Rectangular microstrip patch |
| `"patchMicrostripCircular"` | Circular microstrip patch |
| `"patchMicrostripElliptical"` | Elliptical microstrip patch |
| `"patchMicrostripInsetfed"` | Inset-fed microstrip patch |
| `"patchMicrostripEnotch"` | E-notch microstrip patch |
| `"patchMicrostripHnotch"` | H-notch microstrip patch |
| `"patchMicrostripTriangular"` | Triangular microstrip patch |
| `"pifa"` | Planar inverted-F antenna |
| `"dipoleHelix"` | Helical dipole |
| `"waveguide"` | Open-ended waveguide |
| `"horn"` | Pyramidal horn |
### Creation
Create an AIAntenna using `design` with `ForAI=true`. **Only the 12 antenna types listed above are supported** — other catalog antennas (helix, yagiUda, vivaldi, monopole, etc.) do not have pretrained AI models.
```matlab
freq = 2.4e9;
% Create AI model from a supported catalog antenna
ant = patchMicrostrip;
antAI = design(ant, freq, ForAI=true);
% Or directly with the antenna constructor
antAI = design(horn, 10e9, ForAI=true);
```
`design(..., ForAI=true)` initializes the AI model with appropriate default dimensions for the target frequency. The direct `em.ai.AIAntenna()` constructor is not supported — always use `design`. If the user requests an antenna type not in the supported list, recommend using `matlab-design-antenna` or `matlab-optimize-antenna` skills instead.
### Core Workflow
```matlab
freq = 1e9;
antAI = design(horn, freq, ForAI=true);
% View default tunable parameters
defaults = defaultTunableParameters(antAI);
disp(defaults)
% Check tunable ranges
ranges = tunableRanges(antAI);
disp(ranges)
% Visualize geometry
figure; show(antAI);
% Get performance predictions (instant)
fRes = resonantFrequency(antAI);
[bw, fL, fU, matching] = bandwidth(antAI);
fprintf("Resonant frequency: %.3f GHz\n", fRes/1e9);
fprintf("Bandwidth: %.1f MHz (%.3f - %.3f GHz)\n", bw/1e6, fL/1e9, fU/1e9);
fprintf("Matching: %s\n", matching); % "Matched", "Almost", or "Not Matched"
```
### Tuning Parameters
After creation, the AIAntenna object exposes dynamic properties matching the catalog antenna's geometric dimensions. Set them directly:
```matlab
antAI = design(patchMicrostrip, 2.4e9, ForAI=true);
% Check what's tunable and its bounds
ranges = tunableRanges(antAI);
disp(ranges)
% Tune dimensions directly (property names match catalog antenna)
antAI.Length = 0.035;
antAI.Width = 0.045;
antAI.Height = 0.002;
% Instantly check new performance
fRes = resonantFrequency(antAI);
[bw, fL, fU, matching] = bandwidth(antAI);
fprintf("After tuning: fRes=%.3f GHz, BW=%.1f MHz, %s\n", fRes/1e9, bw/1e6, matching);
% Reset to defaults
reset(antAI);
```
### Tunable Ranges
`tunableRanges` returns a table with bounds for each tunable property:
```matlab
ranges = tunableRanges(antAI); % default: "all" bounds
ranges = tunableRanges(antAI, "strict"); % tighter bounds (higher accuracy)
ranges = tunableRanges(antAI, "loose"); % wider bounds (may reduce accuracy)
```
Use `"strict"` bounds for best prediction accuracy. Parameters outside strict bounds may give unreliable results.
### Peak Radiation and Beamwidth
```matlab
freq = 5.8e9;
ai = design(horn, freq, ForAI=true);
% Peak radiation (gain and direction)
[peakGain, az, el] = peakRadiation(ai, freq);
fprintf("Peak gain: %.2f dBi at az=%.1f, el=%.1f deg\n", peakGain, az, el);
% Beamwidth
[hpbw, angles, plane] = beamwidth(ai, freq);
fprintf("HPBW: %.1f deg (E-plane), %.1f deg (H-plane)\n", hpbw(1), hpbw(2));
```
### Parametric Sweep (Design-Space Exploration)
The main use case — sweep a parameter and plot performance:
```matlab
freq = 2.4e9;
ai = design(patchMicrostrip, freq, ForAI=true);
ranges = tunableRanges(ai, "strict");
% Sweep patch length
lengthRange = linspace(ranges.Length(1), ranges.Length(2), 20);
fResVec = zeros(size(lengthRange));
bwVec = zeros(size(lengthRange));
for k = 1:numel(lengthRange)
ai.Length = lengthRange(k);
fResVec(k) = r>
Analyze AMS waveform data using Mixed-Signal Blockset utilities: phase noise measurement, clock jitter, anti-aliased resampling, timing measurements, lock time, INL/DNL, ADC/DAC calibration, HSpice import. Use when analyzing time-domain voltage from PLL/VCO/clock simulations, measuring phase noise from variable-step solver output, computing jitter, or resampling non-uniform data.
Analyze data using MATLAB. Use when the task involves tables, timetables, time-series data, numeric arrays, sensor matrices, or gridded data — including but not limited to exploring, filtering, sorting, cleaning, transforming, aggregating, smoothing, padding, trimming, and answering questions about data. MATLAB provides extensive, easy-to-use built-in functions for these workflows with no additional products required.
Analyze the effective toolbox file set to produce a Dependency Manifest — classify all transitive dependencies as included, product, add-on, or external-unresolved, then present resolution options with tradeoffs. Use after matlab-define-toolbox-api when the spec is approved.
S-parameters, insertion loss, fields, currents, mesh control, and solver selection for RF PCB performance validation. TRIGGER: user asks to compute S-parameters, analyze insertion/return loss, extract fields or currents, compare MoM vs FEM, or control mesh for any RF PCB component. Invoke BEFORE writing sparameters() or solver code — API is non-obvious. SKIP: designing or creating components (use the specific matlab-design-pcb-* skill), material/stackup setup only (use matlab-manage-pcb-material), optimization sweeps (use matlab-optimize-pcb-design), PDN/IR-drop analysis (use matlab-analyze-pcb-pdn).
Analyze antennas installed on electrically large conducting platforms using MATLAB Antenna Toolbox. Loads platform geometry from STL/STEP/IGES, installs antenna elements, selects electromagnetic solvers (MoM-PO, FMM, MoM), and computes patterns, impedance, coupling, and efficiency. Use when the user wants to model an antenna on a vehicle, aircraft, ship, satellite, or other large structure.
PDN DC voltage/current analysis, IR drop, design rule checking, and multi-net batch analysis on imported PCB layouts. TRIGGER: user asks about power integrity, PDN analysis, IR drop, voltage distribution, current density, power nets, or design rule checking on a PCB. Invoke BEFORE writing code — the PDN API chain is specialized and non-obvious. SKIP: importing a PCB file (use matlab-read-pcb-layout), EM field/S-parameter extraction (use matlab-analyze-em), material/stackup setup only (use matlab-manage-pcb-material), transmission line design (use matlab-design-pcb-txline).
Calculate and visualize monostatic and bistatic radar cross section (RCS) using MATLAB Antenna Toolbox. Computes RCS of platforms, antennas, and arrays with PO, MoM, and FMM solvers, supporting HH/VV/HV/VH polarization, GPU acceleration, and near-field observation. Use when the user wants to compute, plot, or analyze radar cross section.