matlab-review-fi-code
Reviews MATLAB fixed-point (fi) code for performance, code generation efficiency, and correctness. Identifies antipatterns and suggests idiomatic improvements. Use when reviewing fi, fimath, numerictype, or quantizenumeric code.
npx skills add matlab/matlab-agentic-toolkit --skill matlab-review-fi-code --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# fi Best Practices Review Reviews MATLAB code for fixed-point (`fi`) best practices and suggests improvements for performance, code generation efficiency, and correctness. ## When to Use - Reviewing MATLAB code that uses `fi`, `fimath`, `numerictype`, or `quantizenumeric` - Optimizing fixed-point simulation speed - Preparing fixed-point code for C or hardware code generation ## When Not to Use - Code using only built-in integer types (`int8`, `uint16`, etc.) without `fi` - Pure floating-point algorithms with no fixed-point intent - Simulink-only workflows where fixed-point is configured through block dialogs (use Fixed-Point Tool instead) ## Checklist When reviewing code, check for ALL of the following: ### 1. Vectorize fi() Calls **Problem**: Scalar `fi()` in a loop is slow due to per-element object construction overhead. **Fix**: Pass entire arrays to `fi()` at once. ```matlab % BAD — slow: per-element fi object construction for k = 1:N x_fi(k) = fi(x(k), 1, 18, 16, F); end % GOOD — fast: single vectorized call, bit-true identical result x_fi = fi(x, 1, 18, 16, F); ``` ### 2. Separate Data Types from Algorithm **Problem**: Hardcoding fi types inside algorithm code makes it impos
- When to Use
- When Not to Use
- Checklist
- 1. Vectorize fi() Calls
- 2. Separate Data Types from Algorithm
- 3. Prevent Bit Growth with Subscripted Assignment
- 4. Configure fimath for Your Target
- 5. Preallocate fi Arrays
- 6. Avoid Division in Fixed-Point
- 7. Replace Expensive Functions with Lookup Tables or CORDIC
- 8. fi Constructor Best Practices
- 9. Use quantizenumeric for Double-Based Quantization
- 10. Manage Floating-Point in Fixed-Point Algorithms
- 11. Profile and Accelerate fi Code
What does the matlab-review-fi-code skill do?
Reviews MATLAB fixed-point (fi) code for performance, code generation efficiency, and correctness. Identifies antipatterns and suggests idiomatic improvements. Use when reviewing fi, fimath, numerictype, or quantizenumeric code.
How do I install it?
Run `npx skills add matlab/matlab-agentic-toolkit --skill matlab-review-fi-code --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From matlab/matlab-agentic-toolkit, a repository with 868 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
