Skip to content

matlab/matlab-agentic-toolkit / skills-catalog/test-and-measurement/matlab-use-vehicle-network

matlab-use-vehicle-network

Unverified

Use 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).

FileKindSize
SKILL.mdskill md13.1 KB
manifest.yamlconfig537 B
references/can/bus-speed-config.mdmarkdown2.2 KB
references/can/channel-creation.mdmarkdown1.5 KB
references/can/database.mdmarkdown3.0 KB
references/can/filters.mdmarkdown2.8 KB
references/can/message-creation.mdmarkdown1.3 KB
references/can/message-extraction.mdmarkdown3.8 KB
references/can/pack-unpack.mdmarkdown2.6 KB
references/can/receive.mdmarkdown1.9 KB
references/can/transmit.mdmarkdown2.3 KB
references/can/troubleshooting/bus-length-guidelines.mdmarkdown3.5 KB
references/can/troubleshooting/diagnostic-workflow.mdmarkdown21.4 KB
references/can/troubleshooting/l1-branches.mdmarkdown11.1 KB
references/can/troubleshooting/l1-domain-knowledge.mdmarkdown6.8 KB
references/can/troubleshooting/l1-failure-scenarios.mdmarkdown3.6 KB
references/can/troubleshooting/l2-analysis-pipeline.mdmarkdown4.5 KB
references/can/troubleshooting/l2-interpretation-tables.mdmarkdown1.8 KB
references/can/troubleshooting/script-interfaces.mdmarkdown2.6 KB
references/shared/channel-lifecycle.mdmarkdown1.1 KB
references/shared/hardware-discovery.mdmarkdown1.1 KB
references/shared/limitations.mdmarkdown1.7 KB
scripts/can/troubleshooting/canBaudRateScanActive.pbinary1.0 KB
scripts/can/troubleshooting/canBaudRateScanPassive.pbinary1.0 KB
scripts/can/troubleshooting/canBurstDetection.pbinary488 B
scripts/can/troubleshooting/canBusLoadCalc.pbinary787 B
scripts/can/troubleshooting/canChannelHealthCheck.pbinary902 B
scripts/can/troubleshooting/canCycleTimeAnalysis.pbinary558 B
scripts/can/troubleshooting/canDiagnosticProbe.pbinary335 B
scripts/can/troubleshooting/canHardwareDiscovery.pbinary290 B
scripts/can/troubleshooting/canLoopbackSelfTest.pbinary628 B
scripts/can/troubleshooting/canSupportSummary.pbinary1.4 KB
scripts/can/troubleshooting/canTrafficOverview.pbinary900 B

references/can/message-extraction.md

View on GitHub
# Message Extraction and Timetables

## Extract Utilities — Filter message arrays after receive

All three work on **arrays of CAN message objects** (not timetables).

### extractAll — Get all instances of a specific message

```matlab
extracted = extractAll(msgs, id, extended);
extracted = extractAll(msgs, 'MessageName');
[extracted, remainder] = extractAll(msgs, id, extended);
```

- `id` — numeric CAN ID to match
- `extended` — `true` for 29-bit IDs, `false` for 11-bit standard
- `'MessageName'` — requires database attached to messages
- Second output `remainder` contains all non-matching messages

### extractRecent — Get most recent instance per message type

```matlab
recent = extractRecent(msgs);                 % one per unique ID
recent = extractRecent(msgs, id, extended);   % most recent of a specific ID
recent = extractRecent(msgs, 'MessageName');
```

- With no filter: returns one message per unique ID (the latest of each)
- With ID or name filter: returns the single most recent matching message

### extractTime — Get messages within a time window

```matlab
extracted = extractTime(msgs, startTime, endTime);
```

- `startTime`, `endTime` — seconds (relative to channel start)
- Returns all messages with timestamps within [startTime, endTime]

## Timetable Conversion — For analysis and plotting

### canMessageTimetable — Convert messages to timetable

```matlab
msgTT = canMessageTimetable(msgs);
msgTT = canMessageTimetable(msgs, db);
```

- Input: message object array, struct, or existing timetable
- With `db`: adds `Name` and `Signals` columns from database definitions
- Output columns: `Time`, `ID`, `Extended`, `Name`, `Data`, `Length`, `Signals`, `Error`, `Remote`
- Useful for `timetable` operations: filtering, sorting, synchronizing with other signals

### canSignalTimetable — Decode signals into a clean timetable

```matlab
sigTT = canSignalTimetable(msgTT);
sigTT = canSignalTimetable(msgTT, 'MessageName');
```

- Input: a message timetable (from `canMessageTimetable` with database)
- Output: timetable with **one column per signal** (numeric values, properly scaled)
- With message name: filters to only that message's signals
- **Requires** the message timetable was created with a database attached

## Key Behaviors

- `extractAll`/`extractRecent`/`extractTime` operate on **message object arrays**, NOT timetables
- `canMessageTimetable`/`canSignalTimetable` produce **timetables** for analysis
- Use `extractAll` to separate a mixed-traffic capture by message ID before decoding
- `canSignalTimetable` is the fastest path from raw receive to plotable signal data
- Signal columns in the output timetable have proper units and scaling from the DBC

## discard — Clear the receive FIFO

```matlab
discard(ch);
```

- Drops all buffered messages from the channel's receive FIFO
- Use before starting a measurement to clear stale data from a previous run
- Channel must be running (after `start`)
- Does NOT stop the channel — just empties the buffer

## Typical Patterns

**Capture, then extract by ID:**
```matlab
start(ch);
pause(5);
allMsgs = receive(ch, Inf);
engineMsgs = extractAll(allMsgs, 0x180, false);
brakeMsgs = extractAll(allMsgs, 0x250, false);
```

**Convert to signal timetable for plotting:**
```matlab
db = canDatabase('vehicle.dbc');
allMsgs = receive(ch, Inf);
msgTT = canMessageTimetable(allMsgs, db);
sigTT = canSignalTimetable(msgTT, 'EngineData');
plot(sigTT.Time, sigTT.EngineSpeed);
```

**Get latest snapshot of all ECU values:**
```matlab
allMsgs = receive(ch, Inf);
snapshot = extractRecent(allMsgs);
```

**Discard stale data before measurement:**
```matlab
start(ch);
pause(1);          % let bus stabilize
discard(ch);       % clear stale messages
pause(5);          % actual measurement window
data = receive(ch, Inf);
```

----

Copyright 2026 The MathWorks, Inc.

----
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: 198kUpdated Claude CodeCodexVerifiedInstall
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: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
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: 194kUpdated Claude CodeCodexVerifiedInstall