# Simulink Frequency Response

Estimate frequency response from Simulink models using frestimate.

- Repository: https://github.com/matlab/simulink-agentic-toolkit (1305 stars)
- Category: Engineering
- License: see repository
- Last updated: 2026-10-29
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add matlab/simulink-agentic-toolkit --skill simulink-frequency-response -g -a claude-code -y`
Codex: `npx skills add matlab/simulink-agentic-toolkit --skill simulink-frequency-response -g -a codex -y`
Cursor: `npx skills add matlab/simulink-agentic-toolkit --skill simulink-frequency-response -g -a cursor -y`
Gemini CLI: `npx skills add matlab/simulink-agentic-toolkit --skill simulink-frequency-response -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add matlab/simulink-agentic-toolkit`

## Description

Estimate frequency response from Simulink models using frestimate. Use when frequency response should be obtained from simulation rather than model linearization.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Simulink Frequency Response Estimation

Obtain frequency response data from Simulink models using simulation-based estimation (`frestimate`) when analytical linearization is not viable or as a validation tool.

## When to Use

- Model contains hard discontinuities (PWM, switching, relay, quantizer) that linearize to zero or NaN
- Validating a linear model against a simulation based linearization of a Simulink model
- Estimating frequency response directly from simulation data

## When NOT to Use

- Model linearizes cleanly with `linearize`, use `simulink-linearize` instead
- Working with measured data only (no Simulink model), use System Identification Toolbox

## Workflow

```
1. Define I/O  →  2. Choose Signal  →  3. Configure  →  4. Estimate  →  5. Fit (optional)
   (linio)          (PRBS/Sinestream)    (constraints)    (frestimate)     (tfest)
```

### Stage 1: Define I/O Points

Determine I/O points for the estimation using this decision sequence. Use the first case that applies:

**Case A, IO points can be inferred from prompt or model context:**

Use the first sub-case that matches:

1. **User specifies explicit I/O signals or blocks** (e.g., "from r to y") → define `linio` points. All `linio` points must reference a block's output port. If a candidate block has no output ports (Outport, Terminator, Scope) → trace upstream to find the source block and port with `model_read`.
   ```matlab
   io = [linio(sprintf("%s/InputBlock", mdl), 1, "input"); ...
         linio(sprintf("%s/OutputBlock", mdl), 1, "output")];
   ```

2. **Root-level Inport/Outport blocks exist** → use `model_read` at root scope (depth `"0"`) to identify root-level Inport/Outport blocks, then define linio at those blocks (trace Outport blocks upstream to their source for the output linio point).

**Case B, Cannot determine IO points:**

The rest: https://github.com/matlab/simulink-agentic-toolkit/blob/HEAD/skills-catalog/control-systems/simulink-frequency-response/SKILL.md
