Fixed-point code reviewer
Give it MATLAB fixed-point code. Get slow or risky patterns found, with cleaner replacements.
Fixed-point code reviewer 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
MATLAB fixed-point code is checked for slow habits and risky patterns, and each one gets a cleaner replacement. Your simulations run faster and your code is ready for C or hardware conversion. It goes through a checklist. It finds fi calls inside loops and replaces them with one array call. It pulls hard-coded data types out of the algorithm into a types table, so you can switch between floating point and fixed point for comparison. It also looks at math settings and number types that waste time or give wrong results. Each finding shows the bad code beside the fixed code. It skips plain integer code and Simulink block settings.
You give it
- MATLAB code that uses fi, fimath or numerictype
- Target (simulation speed, C code or hardware)
- Word lengths you plan to use (optional)
You get
- List of slow or risky patterns found
- Bad and good code side by side
- Types table pulled out of your algorithm
- Notes on code generation readiness
Use it when
- Your fixed-point simulation takes far too long to run.
- You plan to generate C or HDL code and want the MATLAB clean first.
- You want to compare double, single and fixed versions of one algorithm.
- You inherited fi code and do not know if it is written well.
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 with Fixed-Point Designer.