matlab-bridgelisted
Install: claude install-skill infei12306/matlab-bridge
# MATLAB Bridge
Drive the user's **live** MATLAB session on Windows. Nothing is clicked:
commands go in over COM, results come back through files. MATLAB must already be
running.
## Locate the driver
```powershell
$MLB = Join-Path $env:LOCALAPPDATA 'mlbridge\mlbridge.ps1'
if (-not (Test-Path $MLB)) {
# not deployed yet: install from this skill's bundle, then read its DRIVER line
powershell.exe -NoProfile -ExecutionPolicy Bypass -File ".\scripts\install.ps1"
}
```
Invoke it as:
```powershell
powershell.exe -NoProfile -ExecutionPolicy Bypass -File $MLB <args>
```
`-Help` (or no arguments) prints the full option list.
| Goal | Command |
|---|---|
| Run code | `-Code "A = magic(5); disp(sum(A))"` |
| Run a .m file | `-ScriptFile D:\path\job.m` |
| Long job, return at once | `-Code "do_work" -Async` → then `-Status -Id <id>` |
| Long job, wait for it | `-Code "do_work" -Async -WaitSec 300` |
| Push a CSV in | `-Push in.csv -PushName D` (combinable with `-Code`) |
| Pull a variable out | `-Pull D -Out out.csv` |
| See the current figure | `-Shot` (writes a PNG, prints its path) |
## Hard rules
1. **Never read `Execute`'s return value** — the driver already discards it. A
300x300 matrix costs 889 KB of text. Results arrive via the log tail.
2. **`diary` does not work over COM** (measured: the log stays 0 bytes). Output
is captured with `evalc` and written to `<bridge>\logs\<id>.log`.
3. **Use `-Async` for anything slow.** A synchronous call blocks MATLAB and c