Iván

MATLAB

Developmentv1.0.0
By IvánUpdated 2026-05-11matlab@clawhub_ivangdavila/matlab
Bug Fixing

According to AlphaMoat, as of 2026-09, MATLAB has 3,663 downloads and 3 stars — ranked #2,959 of 5,078 AI skills overall, and #385 of 577 in Development.

Installs
344
Downloads
3.7K
Stars
3
Overall Rank
#2,959
Top 59% overall · Top 67% in Development
PlatformInstallsDownloadsStarsComments
ClawHub ↗531.9K3-
SkillHub ↗3443.7K3—

Platforms count differently and update at different times.

What this skill does

It covers matrix versus element-wise operations, vector orientation, preallocation, expansion, missing values, cells, functions and debugging. The skill contains guidance rather than executable code. Match suggestions to the project’s MATLAB release and toolboxes, and confirm an installed, licensed MATLAB environment before running or validating code.

Profile published 2026-10-27

What you can do with it

  • Review MATLAB array and numerical code

When to use it

  • When MATLAB snippets need syntax or shape checks

Example prompts

Generated from the skill’s documentation as examples; not results of actual runs.

Review this MATLAB code for indexing, element-wise operations and array shape, and identify checks to run in the licensed target environment.

Monthly Trend

Downloads3.7K
9392.4K3.9K2026-03 · Downloads 1.1K2026-05 · Downloads 1.8K2026-06 · Downloads 2.0K2026-07 · Downloads 2.3K2026-08 · Downloads 2.6K2026-09 · Downloads 3.7K26-0326-09
Stars3
2342026-03 · Stars 32026-05 · Stars 32026-06 · Stars 32026-07 · Stars 32026-08 · Stars 32026-09 · Stars 326-0326-09

The counting method changed in 2026-09: skills with the same name are now counted separately by author, and the full catalog is covered. Dashed lines show months before the change; they are not compared with later months, and no growth is computed across the change.

MonthDownloadsMoMStars
2026-093.7K—3
2026-082.6K+15.7%3
2026-072.3K+15.9%3
2026-062.0K+11.2%3
2026-051.8K—3
2026-031.1K—3

SKILL.md (original)

The author’s original file, shown as plain text without edits or review by AlphaMoat. Links are not clickable; check commands before running them. Fetched 2026-10-23.

2.9 KB · ClawHub v1.0.0
---
name: MATLAB
description: Avoid common MATLAB mistakes — indexing traps, matrix vs element-wise ops, and vectorization pitfalls.
metadata: {"clawdbot":{"emoji":"📐","requires":{"bins":["matlab"]},"os":["linux","darwin","win32"]}}
---

## Indexing
- 1-based indexing — first element is `A(1)`, not `A(0)`
- `end` keyword for last index — `A(end)`, `A(end-1)`, works in any dimension
- Linear indexing on matrices — `A(5)` accesses 5th element column-major order
Show all (63 lines)
- Logical indexing returns vector — `A(A > 0)` gives 1D result regardless of A's shape

## Matrix vs Element-wise
- `*` is matrix multiplication — `.*` for element-wise
- `/` solves `A*x = B` — `./` for element-wise division
- `^` is matrix power — `.^` for element-wise power
- Forgetting the dot is silent bug — dimensions might accidentally match

## Vector Shape Matters
- Row vector: `[1 2 3]` or `[1, 2, 3]` — shape is 1×3
- Column vector: `[1; 2; 3]` — shape is 3×1
- Transpose with `'` (conjugate) or `.'` (non-conjugate) — for complex, they differ
- `*` between row and column gives scalar or matrix — depending on order

## Array Preallocation
- Growing arrays in loops is slow — preallocate: `A = zeros(1000, 1)`
- `zeros`, `ones`, `nan` for preallocation — specify size upfront
- Cell arrays: `cell(n, m)` — preallocate cells too

## Broadcasting
- Implicit expansion since R2016b — `A + b` works if dimensions compatible
- Singleton dimensions expand — `[1;2;3] + [10 20]` gives 3×2
- Before R2016b needed `bsxfun` — legacy code may still use it

## NaN Handling
- `NaN ~= NaN` is true — use `isnan()` to check
- Most operations propagate NaN — `sum([1 NaN 3])` is NaN
- Use `'omitnan'` flag — `sum(A, 'omitnan')`, `mean(A, 'omitnan')`

## Cell Arrays vs Matrices
- `{}` for cell arrays — hold mixed types, different sizes
- `()` indexing returns cell — `C(1)` is 1×1 cell
- `{}` indexing extracts content — `C{1}` is the actual value
- Comma-separated list from `C{:}` — useful for function arguments

## Common Mistakes
- `=` for assignment, `==` for comparison — `if x = 5` is error in MATLAB
- Semicolon suppresses output — forget it and flood command window
- `clear` removes all variables — use `clearvars` for selective, `close all` for figures
- `i` and `j` are imaginary unit — don't use as loop variables, or reassign explicitly
- String vs char: `"text"` vs `'text'` — double quotes are string arrays (R2017a+)

## Functions
- Anonymous functions: `f = @(x) x^2` — quick inline functions
- Multiple outputs: `[a, b] = func()` — must capture or use `~` to ignore
- `nargin`/`nargout` for optional args — check how many inputs/outputs provided
- `varargin`/`varargout` for variable args — cell array of extra arguments

## Debugging
- `dbstop if error` — breakpoint on any error
- `keyboard` in code pauses execution — enter debug mode at that line
- `whos` shows variable sizes — `size(A)` for specific variable

Popular in Development

More from Iván

Data month: 2026-09 · Downloads, stars and installs are aggregated monthly from public skill registries (ClawHub, SkillHub). See methodology.