Skip to main content
ClaudeWave
EN, English
Skill1.2k repo starsupdated 6d ago

matlab-install-products

This Claude Code skill automates the installation of MATLAB, Simulink, toolboxes, and support packages using MATLAB Package Manager (mpm) from the command line with deterministic, repeatable behavior. Use it when setting up scripted MATLAB installations for CI/CD pipelines, containerized environments, fleet provisioning, or adding products to existing installations via the OS command line.

Install in Claude Code
Copy
git clone --depth 1 https://github.com/matlab/matlab-agentic-toolkit /tmp/matlab-install-products && cp -r /tmp/matlab-install-products/skills-catalog/matlab-core/matlab-install-products ~/.claude/skills/matlab-install-products
Then start a new Claude Code session; the skill loads automatically.

SKILL.md

# Installing MATLAB Products with MATLAB Package Manager (mpm) - Deterministic Protocol

Use this skill when asked to install MathWorks products using MATLAB Package Manager (mpm) from the OS command line.

$ARGUMENTS

## When to Use

- User asks to install MATLAB, Simulink, toolboxes, or support packages via the command line
- User wants a scripted, repeatable MATLAB installation (CI/CD, containers, fleet provisioning)
- User asks about mpm, MATLAB Package Manager, or non-interactive MATLAB installs
- User needs to add products to an existing MATLAB installation using mpm

## When NOT to Use

- User wants to install via the graphical MATLAB installer or MathWorks website
- User is asking about MATLAB licensing or activation (separate workflow)
- User wants to manage MATLAB Add-Ons from within MATLAB (use the Add-On Manager)
- User needs to install MATLAB Engine API for Python, Java, or C++ (different process)

## Non-Negotiable Determinism Contract (follow exactly)
- Follow the steps in **Protocol** in order. Do not add extra steps or checks.
- Use **only** the canonical shell for the OS. Do not switch shells.
- Use **absolute paths** to `mpm` / `mpm.exe`. Never rely on relative paths.
- Retry downloads at most **once**. Otherwise stop and report the error.
- If security software blocks execution: **stop** and instruct escalation. Do not bypass.

## Safety Gate (Windows) — MANDATORY, NO EXCEPTIONS

**STOP. Read this entire section before executing ANY Windows step.**

1. **NEVER** use `powershell.exe -Command` for ANY reason. Bash mangles `$`, backticks, quotes, arrays, and script blocks before PowerShell sees them. This WILL cause `unexpected EOF` or syntax errors.
2. **NEVER** create any file with a bash heredoc (`cat > file <<'EOF' ... EOF`) or shell redirection (`echo ... > file`, `printf ... > file`, `>>`). This includes **quoted** heredocs (`<<'PS1'`, `<<"EOF"`). Do not rationalize an exception: the reason is NOT variable expansion (so "the delimiter is quoted, so it's safe" is wrong). The reasons the ban is absolute are (a) Git Bash rewrites paths, line endings, and encoding as it creates the file, corrupting `.ps1` parsing, and (b) the **Write file tool is the single approved mechanism for creating any file in this protocol** — scripts and input files alike. There is no safe heredoc. If you catch yourself reaching for `cat`, `echo`, `printf`, `>`, `>>`, or `<<` to produce a file, STOP and use the Write file tool.
3. **ALWAYS** write `.ps1` files using the **Write file tool**, then invoke with:
   `powershell.exe -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Bypass -File <absolute-script-path>`
4. Do not emit CMD-only syntax (`if not exist`, `set VAR=`, `%USERPROFILE%`). Use PowerShell equivalents (`Test-Path`, `$env:USERPROFILE`).

5. **ASCII only** in all `.ps1` file content. No em dashes (`—`), en dashes (`–`), curly quotes, or other non-ASCII characters. They cause PowerShell parse errors (broken string terminators, missing brace errors) when file encoding doesn't preserve them.

**If you are about to type `powershell.exe -Command` — STOP. You are violating this rule. Use the Write file tool to create a .ps1 file instead.**

Windows script authoring pattern:
- **WRONG**: `powershell.exe -Command "$script = @'...`  (bash corrupts `$` and heredocs)
- **WRONG**: `cat > C:/Windows/Temp/script.ps1 <<'PS1' ... PS1`  (bash heredoc — banned even with a quoted `'PS1'` delimiter)
- **WRONG**: `echo '...' > script.ps1` or `printf '...' > script.ps1`  (shell redirection — banned)
- **CORRECT**: create a unique temp folder, use the **Write file tool** to write `.ps1` files into it, then run with `-File`

The only Bash tool commands allowed in this protocol are: `mkdir -p` (create the working folder), `powershell.exe ... -File` (invoke a script), `test -f` (verify artifacts), and `rm -rf` (cleanup). Any Bash command that would create or write file *content* is a violation — file content comes from the Write file tool, always.

Unique temp folder:
- Before Step 1, create a timestamped working folder using the Bash tool:
  - Windows: `mkdir -p "C:/Users/<username>/AppData/Local/Temp/mpm-<YYYYMMDD-HHMMSS>"`
  - Linux/macOS: `mkdir -p "/tmp/mpm-<YYYYMMDD-HHMMSS>"`
- Use this folder for ALL generated scripts and input files throughout the protocol
- Because the folder is new, the Write file tool can always create files in it without needing to delete anything first
- Delete the entire folder during the final cleanup step

Windows PowerShell syntax reminders:
- Bad: `if not exist C:\Users\name\Downloads mkdir C:\Users\name\Downloads` (CMD syntax)
- Good: `if (-not (Test-Path -LiteralPath 'C:\Users\name\Downloads')) { New-Item -ItemType Directory -Path 'C:\Users\name\Downloads' | Out-Null }`

Do not ask the user for the exact product name or identifier. Look it up using the appropriate mpm input file from https://www.mathworks.com/products/mpm.html
Do not ask the user whether to install dependencies or not. mpm will take care of it. Just install whatever the user asked for, and let mpm do the rest.
If a user types the shortname of MATLAB releases, automatically use the correct expanded full name. e.g. 25a is R2025a, 25b is R2025b

## Required Inputs (ask only if missing)
1. Operating system (Windows, Linux, macOS)
2. MATLAB release (for example `R2025b`)
3. Installation destination (absolute path)
4. Requested products / toolboxes / support packages

## Confirmation Rule
Before executing any steps, always confirm the user's choices:
- Release
- Destination folder
- Products
- Support packages

Ask for confirmation in one message. The user can reply `yes to all` to confirm everything at once. If they reply with specific changes, update the selections and confirm again.
Display each value to be confirmed in its own new line.
Note at the bottom of the confirmation message: "Required dependencies will be installed automatically by mpm."

## Plan Display (after confirmation, before execution)
matlab-access-datafeedSkill

>

matlab-analyze-ams-waveformSkill

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.

matlab-analyze-dataSkill

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.

matlab-analyze-dependenciesSkill

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.

matlab-analyze-emSkill

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).

matlab-analyze-installed-antennaSkill

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.

matlab-analyze-pcb-pdnSkill

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).

matlab-analyze-rcsSkill

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.