Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions skills/matlab-performance-optimizer/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -519,16 +519,16 @@ Before finalizing optimized code, verify:

### Pitfall 3: Ignoring Memory Access Patterns
```matlab
% SLOW - column-wise access (MATLAB is column-major)
for j = 1:cols
for i = 1:rows
% SLOW - row-wise iteration (MATLAB is column-major)
for i = 1:rows
for j = 1:cols
A(i,j) = process(i, j);
end
end

% FAST - row-wise iteration, column-wise access
for i = 1:rows
for j = 1:cols
% FAST - column-wise iteration
for j = 1:cols
for i = 1:rows
A(i,j) = process(i, j);
end
end
Expand Down