MATLAB memory saver
Give it code that runs out of memory. Get the cause found, fixed and measured, with a short report.
MATLAB memory saver is a free AI skill for the job "Test and fix code". Give the instructions to an AI assistant that supports the required files and tools, then review its output.
Free · No account · BSD 2 Clause licence · Made by MathWorks · Level: advanced
Made by MathWorks. See the original on GitHub; we copied it as it is, with its licence.
What it does
A MATLAB script that no longer runs out of memory, with proof of how much it saved. You give it the code that crashes or crawls, and it finds what is eating the memory, changes it and measures again. The skill works in seven steps. It takes a baseline, profiles memory use, finds the costly spots, makes changes, measures again, checks that the results are identical and writes a short report. Its main rule is to measure before it changes anything, never to guess from the source.
You give it
- The code that uses too much memory
- Typical data size
- Your operating system
- A sample run command
You get
- The memory hot spots found
- Optimised code
- Before and after measurements
- A proof that results match
- A short report
Use it when
- Your script stops with an out of memory error on big data.
- MATLAB slows down after a long run and you do not know why.
- You need the same results with a smaller memory footprint.
- You want a before and after figure to show your team.
How to use it
- Add it to your AI once: download it and add the folder to Claude, ChatGPT or Codex as a skill.
- Ask for the job in your own words. Your AI opens the skill when it fits.
- It works best when your AI can run MATLAB.