Agent skill · Audited from source
Matlab Modernize Code
skill · matlab/matlab-agentic-toolkitNOASSERTION licenceAudited 14 Oct 2026 · source 58967e6f32b5
Is it safe? With care — CAUTION, grade C (79/100). We read this skill's source at commit 58967e6f32b5 and found no filesystem, network or shell access and no hard-coded secrets. The audit raised 1 finding, 1 critical or high. What it does: Modernize removed or discouraged MATLAB functions and patterns. Use when the check_matlab_code MCP tool reports that a function "is not recommended", "will be removed in a future release", or "has been removed" — at any…
Cite
Cite this page
ModelsAtlas. “Matlab Modernize Code (matlab/matlab-agentic-toolkit)”. Retrieved 14 Oct 2026. https://modelsatlas.com/skills/matlab/matlab-modernize-code
Trust audit
Audit 0.4.1 · source read 14 Oct 2026
CAUTION means the audit found things worth knowing before you trust this skill. Grade C is shared by 105 of 18,389 audited skills.
What the source does
- FilesystemNone observedNo reads or writes in the source
- NetworkNone observedNo outbound calls in the source
- ShellNone observedNo commands run in the source
- DependenciesPinnedNothing floats
- SecretsNone foundNo keys in source
Five audit layers
| Layer | What we check | Result | Findings |
|---|---|---|---|
L0 Provenance | Repo owner, licence, archive status, activity | PASS | 0 |
L1 Static source | Secrets, path traversal, supply chain, hidden code | NA | 0 |
L2 Instructions | Prompt injection, authority framing, hidden directives | FAIL | 1 |
L3 Inventory | The files and declarations match the source | PASS | 0 |
L4 Sandbox | Run in isolation and watch behaviour | SKIPPED why | 0 |
Gates applied: instruction override, no behavioural pass.
Findings (1)
HIGHPrompt injectionprompt.hide_from_user · SKILL.md:164
- **`subplot` is *not* deprecated or discouraged.** It is fully supported and is never flagged by `check_matlab_code`. `tiledlayout`/`nexttile` is a *preferred alternative for new code, not a required
- Why
- asks the agent to act without the user's knowledge
- Fix
- —
Audit 0.4.1 · source sha 58967e6f32b5 · 14 Oct 2026Report an issue or request a re-scan
Provenance
Who published it, and what the verdict is pinned to
- Publishermatlab GitHub organizationOwner of the repository this skill is read from
- Source foldermatlab/matlab-agentic-toolkit/skills-catalog/matlab-software-development/matlab-modernize-codeThe exact folder we audited
- LicenceNOASSERTIONAs the repository states it
- Commit pinned for this verdict58967e6f32b5A new audit runs when the source changes
- Repository statusNot archivedLast push 5 days ago
- Sandboxed runNot runSkills are read, not executed; layer L4 is skipped
What it tells the agent
Full source on GitHub ↗Its description: Modernize removed or discouraged MATLAB functions and patterns. Use when the check_matlab_code MCP tool reports that a function "is not recommended", "will be removed in a future release", or "has been removed" — at any…
---
name: matlab-modernize-code
description: >
Modernize removed or discouraged MATLAB functions and patterns. Use when the
check_matlab_code MCP tool reports that a function "is not recommended",
"will be removed in a future release", or "has been removed" — at any
severity (info, warning, or error) — when migrating legacy code, or when
replacing removed or discouraged APIs with current equivalents. Also applies
to discouraged patterns Code Analyzer does not flag (containers.Map, bsxfun,
str2num, eval, clear all) and to removed or discouraged functions such as
trainNetwork, csvread, xlsread, datenum, guide, svmtrain, ltln2val, webmap.
license: https://www.mathworks.com/content/dam/mathworks/license/pmrl/license.md
metadata:
author: MathWorks
version: "1.3"
---
# Code Modernization
Replace removed or discouraged MATLAB functions and anti-patterns with modern equivalents. This skill is the resolver — the MCP tool `check_matlab_code` (MATLAB's Code Analyzer) is the detector.
**Terms used in this skill:**
- **Removed** — the function is no longer in MATLAB; calling it errors.
- **Discouraged** — the function still works, but a better API exists. It may or may not be slated for removal in a future release.
## When to Use
- `check_matlab_code` reports a lifecycle diagnostic — any of these three
wordings, matched case-insensitively (`STRMATCH is not recommended` is the
same signal as the lowercase form):
- `'X' is not recommended...` (severity: info)
- `'X' will be removed in a future release...` (severity: warning)
- `'X' has been removed...` (severity: error — the code errors today)
- Code uses a discouraged pattern Code Analyzer does *not* flag — e.g. `containers.Map`, `bsxfun`, `str2num`, `eval`, `clear all` — scan the source, not just the diagnostics (see Conventions)
- User asks to modernize, migrate, or update old MATLAB code
- Code uses functions listed in the quick reference table below
- After static analysis reveals removed or discouraged API usage
- Writing new code in a domain that has known removed or discouraged patterns
## When NOT to Use
This skill swaps removed or discouraged APIs for modern equivalents. It does not:
- Review code quality broadly
- Debug runtime behavior (removed-function errors excepted — those are modernization fixes)
- Optimize already-correct code for speed → hand off to `matlab-optimize-performance`
- Write or migrate function input/output validation (`arguments` blocks, `inputParser`/`validateattributes` → `mustBe*` validators, repeating args, name-value forwarding) → hand off to `matlab-validate-function-arguments`
## Quick Reference: Removed, Discouraged & Anti-Patterns
| Topic | Recommendation | Since | Category | Rationale |
|---|---|---|---|---|
| `csvread` / `dlmread` | `readmatrix` | R2019a | File I/O | |
| `csvwrite` / `dlmwrite` | `writematrix` | R2019a | File I/O | |
| `xlsread` | `readtable`, `readmatrix` | R2019a | File I/O | |
| `xlswrite` | `writetable`, `writematrix` | R2019a | File I/O | |
| `datenum` / `datestr` / `now` | `datetime` (use `string`/`char` to format) | R2022b | Date/Time (Not recommended) | Flagged by Code Analyzer |
| `eval` / `evalc` / `evalin` | Dynamic field names `s.(name)`, function handles / `feval`, cells for sequential names | — | Anti-pattern | Not compiled (slow); can overwrite workspace vars; hard to debug; injection risk |
| `str2num` | `str2num(text, Evaluation="restricted")` | R2022a | Security | Unrestricted form runs input via `eval` (injection risk); see references |
| `uicontrol` | `uibutton`, `uidropdown`, etc. | R2016a | UI/App | |
| `guide` | `appdesigner` | R2025a | UI (Removed) | |
| `strmatch` | `startsWith`, `matches` | R2019b | Strings | |
| `clear all` | `clearvars` | — | Workspace | Clears functions from memory; forces recompilation |
> **`datestr` nuance:** `datestr`'s job was to format a date as *text*, so its modern replacement is
> `string(dt)` / `char(dt)` or setting `dt.Format` — not a bare `datetime(...)` call. Use `datetime`
> to replace `datenum`/`now` (the numeric/serial-date path). Neither is removed; both are Code
> Analyzer "not recommended" as of R2022b.
>
> ```matlab
> s = datestr(t, 'yyyy-mm-dd HH:MM:SS'); % old
> s = string(t, 'yyyy-MM-dd HH:mm:ss'); % new — note the specifiers change:
> % datetime uses MM=month, mm=minute (datestr had mm=month, MM=minute)
> ```
## Modern Design Patterns
Prefer these in all new code:
### Table-Based Workflows
```matlab
data = readtable('sensors.csv');
data.Timestamp = datetime(data.Timestamp);
data.Status = categorical(data.Status);
recentData = data(data.Timestamp > datetime('today') - days(7), :);
summary = groupsummary(recentData, 'SensorID', 'mean', 'Value');
```
### String Arrays (not char arrays)
```matlab
name = "John"; % not 'John'
names = ["John", "Jane", "Bob"]; % not {'John','Jane','Bob'}
fullName = firstName + " " + lastName; % not [first,' ',last]
idx = contains(names, "Jo"); % not cellfun + strfind
```
### Arguments Block (not nargin/varargin)
```matlab
function result = processData(data, options)
arguments
data (:,:) double
options.Method (1,1) string {mustBeMember(options.Method, ["fast","accurate"])} = "fast"
options.Verbose (1,1) logical = false
end
end
```
## Key Migrations
### File I/O: csvread/xlsread → readmatrix/readtable
```matlab
% Old → Modern
M = csvread('data.csv'); % M = readmatrix("data.csv");
M = dlmread('data.txt','\t'); % M = readmatrix("data.txt", Delimiter="\t");
[n,t,r] = xlsread('f.xlsx'); % T = readtable("f.xlsx");
csvwrite('out.csv', M); % writematrix(M, "out.csv");
xlswrite('out.xlsx', data); % writetable(T, "out.xlsx");
```
### eval → Structured Alternatives
Avoid `eval`/`evalc`/`evalin`: the text isn't compiled (slower), can silently overwrite workspace
variables, and is hard to rExcerpt, first 6,000 characters of SKILL.md, verbatim from the audited commit. It is text from someone else’s repository, quoted so you can judge it before your agent reads it.
Install
Pinned to the audited commit 58967e6
git clone https://github.com/matlab/matlab-agentic-toolkit git -C matlab-agentic-toolkit checkout 58967e6f32b5
The author documents no install command, so this uses the repository directly. Our verdict covers commit 58967e6f32b5 only.
Works in
The author has not said which agents this skill supports, and we have not tested it in any.
Audit history
Every audit, every source change
- !CAUTION C 79 / 100
first audit · source
58967e6f32b5
README badge
For maintainers · shows the latest audit
[](https://modelsatlas.com/skills/matlab/matlab-modernize-code/)
The badge shows our verdict and grade for this skill, and links back to this page. It changes when the audit does.
Similar skills
matlab/matlab-agentic-toolkit
Read BEFORE writing any code that adds Additive White Gaussian Noise (AWGN) to signals and converts between SNR, Eb/No, Es/No, and per-subcarrier SNR for communications simulations, using awgn(), convertSNR(),…
matlab/matlab-agentic-toolkit
The MATLAB Agentic Toolkit brings proven MATLAB capabilities to AI agents, making engineering and scientific workflows agent-ready.
matlab/matlab-agentic-toolkit
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, row filtering, sorting, cleaning,…
matlab/matlab-agentic-toolkit
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…
matlab/matlab-agentic-toolkit
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…
matlab/matlab-agentic-toolkit
The MATLAB Agentic Toolkit brings proven MATLAB capabilities to AI agents, making engineering and scientific workflows agent-ready.
Add this badge to your README
[](https://modelsatlas.com/skills/matlab/matlab-modernize-code/)
<a href="https://modelsatlas.com/skills/matlab/matlab-modernize-code/"><img src="https://modelsatlas.com/skills/matlab/matlab-modernize-code/badge.svg" alt="ModelsAtlas: CAUTION C"></a>
Questions about Matlab Modernize Code
What does the Matlab Modernize Code skill do?
Is Matlab Modernize Code safe to install?
What can Matlab Modernize Code access on my machine?
How current is this page?
Sources
- github.com/matlab/matlab-agentic-toolkit/tree/main/skills-catalo — the audited source at commit 58967e6f32b5 and every finding aboveObserved · 14 Oct 2026
Spotted something wrong? Report a correction · Methodology
Keep going in your AI
Opens with this page as the source. We add nothing else to the prompt.
- What does the Matlab Modernize Code skill do?
- Is Matlab Modernize Code safe to install?
- What can Matlab Modernize Code access on my machine?