Install any skill in seconds. Free to start, no credit card required.
Get Started Free →matlab/matlab-review-fi-code
Reviews MATLAB fixed-point (fi) code for performance, code generation efficiency, and correctness. Identifies antipatterns and suggests idiomatic improvements.
Passed 18 of 23 test cases with the skill, and 6 of 23 without it.
and 15 more in the full report
12 fixed6 passed either way5 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 12 test cases the skill fixed. Same model, same prompt, with and without the skill.
In my loop, I append fixed-point outputs using `Y(k) = cast(x(k), 'like', T)` without allocating `Y` before the loop starts. Execution speed degrades quadratically with length. How should I preallocate `Y`?
| Checked | Without skill | With skill |
|---|---|---|
| Recommends preallocating with zeros using the like prototype pattern | Passed | Passed |
| Cites Check 5 for preallocating fi arrays | Missed | Passed |
The instructions your model reads when the skill loads.
Reviews MATLAB code for fixed-point (fi) best practices and suggests improvements for performance, code generation efficiency, and correctness.
fi, fimath, numerictype, or quantizenumericint8, uint16, etc.) without fiWhen reviewing code, check for ALL of the following:
Problem: Scalar fi() in a loop is slow due to per-element object construction overhead.
Fix: Pass entire arrays to fi() at once.
% 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);
Problem: Hardcoding fi types inside algorithm code makes it impossible to switch between float/fixed or compare configurations.
test cases passed, vs 6 / 23 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.