matlab/matlab-agentic-toolkit / skills-catalog/test-and-measurement/matlab-use-vehicle-network
matlab-use-vehicle-network
UnverifiedUse when setting up vehicle network communication in MATLAB using Vehicle Network Toolbox. Covers CAN/CAN FD (fully implemented), with architecture for J1939, XCP, and future protocols. Handles hardware discovery, channel creation, bus configuration, message exchange, signal encoding/decoding, and analysis across all supported vendors. (Vector, Kvaser, PEAK-System, NI, SocketCAN, MathWorks Virtual).
references/shared/channel-lifecycle.md
View on GitHub# Start, Stop, and Cleanup
## start / stop
```matlab
start(ch); % Begin bus participation
stop(ch); % Leave bus
```
## Requirements
- For CAN FD channels, `configBusSpeed` **must** be called before `start`
- Channel also stops when you `clear` the variable from workspace
## Cleanup Pattern
```matlab
ch = canChannel("MathWorks", "Virtual 1", 1);
cleanup = onCleanup(@() stop(ch));
configBusSpeed(ch, 500000);
start(ch);
% ... work with channel ...
% If error occurs, onCleanup ensures stop(ch) is called
```
## Why Cleanup Matters
- Errors mid-script leave channels in running state
- Running channels hold InitializationAccess — blocking new channel creation
- `clear all` triggers destructors for all in-scope channel objects
- `clear ch` specifically stops and releases that one channel
## Releasing a Channel
```matlab
stop(ch); % explicit stop
clear ch; % releases from workspace, also stops if running
```
No need to call both — `clear` alone is sufficient. Use explicit `stop` when you want to keep the variable but take the channel offline.
----
Copyright 2026 The MathWorks, Inc.
----
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |