matlab-import-tracking-data

$npx mdskill add matlab/matlab-agentic-toolkit/matlab-import-tracking-data

Import raw trajectory data into MATLAB tracking formats.

  • Converts CSV, XLSX, TXT, or tables for tracking workflows.
  • Depends on Sensor Fusion and Tracking Toolbox and MATLAB I/O functions.
  • Selects output format based on user goal: replay, tune, or evaluate.
  • Generates plain MATLAB code for direct use by the user or agent.

SKILL.md

.github/skills/matlab-import-tracking-dataView on GitHub ↗
---
name: matlab-import-tracking-data
description: "Import raw ground truth data (CSV, XLSX, TXT, or MATLAB tables) into formats used by Sensor Fusion and Tracking Toolbox: trackingScenarioRecording, tuning data timetable, truthlog struct array, or a clean converted table. Use when the user has recorded position/trajectory data and wants to: replay a tracking scenario from real data, tune tracking filters (EKF, UKF, IMM) with recorded truth, or assess tracker accuracy (GOSPA, OSPA, assignment metrics) against ground truth. Also use when the user mentions trackingDataImporter, importing flight logs, GPS logs, ADS-B data, AIS ship tracks, radar recordings, driving logs, or converting raw position data for use with trackers."
license: MathWorks BSD-3-Clause
metadata:
  author: MathWorks
  version: "1.0"
---

# Tracking Data Import

Import raw ground truth data into MATLAB for use with Sensor Fusion and Tracking Toolbox. This skill drives an agent workflow that writes plain MATLAB code — no App or internal APIs needed.

## When to Use

- User has recorded trajectory/position data (CSV, XLSX, TXT, or MATLAB table) and wants to bring it into MATLAB for tracking workflows
- User wants to replay a real-world scenario with `trackingScenarioRecording`
- User wants to tune tracking filters (EKF, UKF, IMM) using `trackingFilterTuner` and needs truth data in the right format
- User wants to evaluate tracker accuracy (GOSPA, OSPA, assignment metrics) and needs a truth log
- User mentions flight logs, GPS logs, ADS-B data, AIS ship tracks, radar recordings, or driving logs in the context of tracking
- User asks about `trackingDataImporter` or importing ground truth for trackers

## When NOT to Use

- User is generating synthetic scenarios from scratch (use `trackingScenario` directly)
- User already has data in the correct SFTT format and just needs to run a tracker
- User needs to import sensor detections (not truth/ground-truth data)
- User is working with image/video data rather than position/trajectory data

## Output Formats

| Output | Type | Use With |
|---|---|---|
| **Scenario Recording** | `trackingScenarioRecording` | `play`, scenario replay |
| **Tuning Data** | timetable / cell of timetables | `trackingFilterTuner` |
| **Truth Log** | cell array of struct arrays | `trackGOSPAMetric`, `trackAssignmentMetrics` |
| **Converted Table** | `table` | General inspection |

## Agent Workflow

### Step 1: Ask the User (2 questions only)

1. **What output do you need?** (recording / tuning data / truth log / converted table)
2. **Where is the data?** (file path or workspace variable name)

### Step 2: Inspect the Data

Read the data and display column names + sample rows. From this, **infer** the data model — do not ask the user yet:

- **Geo vs Cartesian**: lat/lon columns → geodetic; x/y/z → Cartesian
- **Category**: Flight log, GPS log, driving log, or custom (see `references/interpreter-categories.md`)
- **Time column & format**: name pattern + value magnitude (large → epoch, small → elapsed)
- **Platform/Class ID columns**: name patterns like "id", "pid", "object_id"
- **Position, velocity, orientation, dimension columns**: match by name
- **Units**: default to degrees/meters/m-per-s; adjust if names hint otherwise ("alt_ft", "speed_kts")

### Step 3: Propose Mapping — Let User Confirm/Edit

Present a table of inferred mappings:

> | State Element | Column | Unit |
> |---|---|---|
> | Time (DateTime) | `"timestamp"` | sec (posix epoch) |
> | Platform ID | `"aircraft_id"` | — |
> | Latitude | `"lat"` | degree |
> | ... | ... | ... |
>
> **Unmapped columns** (ignored): `"signal_strength"`, `"battery"`
>
> Does this look right? Edit anything that's wrong.

Iterate until the user confirms.

### Step 4: Ask About Output Frame (geo data only)

Requires Mapping Toolbox or Aerospace Toolbox for coordinate transforms (`wgs84Ellipsoid`, `geodetic2ecef`, `ned2ecefv`). If geodetic data is detected and neither toolbox is available, suggest that the user install one of these toolboxes.

Only for geodetic/earth-referenced data. Options:
- Cartesian ECEF
- Cartesian Fixed NED / ENU (requires origin lat/lon/alt)
- Geodetic Local NED / ENU

Default: same as input. Skip for Cartesian Scenario or Driving data.

### Step 5: Generate and Run Code

Write MATLAB code following the patterns in `references/code-patterns.md`. Key steps:
1. Read data → extract columns → convert units → parse time
2. Remap platform IDs to sequential integers (1, 2, 3, ...)
3. Transform coordinates if needed (see `references/coordinate-transforms.md`)
4. Build the output structure (see `references/output-formats.md`)
5. Sort by time before building output

### Step 6: Visualize

After conversion, offer to visualize. See `references/visualization.md`.
- **Geo data** → `trackingGlobeViewer` (globe with trajectories)
- **Non-geo data** → `theaterPlot` (3D axes with trajectories)

Offer interactive follow-ups: highlight a platform, show a time step, zoom in.

---

## Reference Documents

Read these on-demand when you need the details:

- `references/output-formats.md` — Exact struct/table schemas for all four output types
- `references/code-patterns.md` — Complete end-to-end code examples (flight log, driving log, GPS log)
- `references/coordinate-transforms.md` — When and how to transform between frames
- `references/visualization.md` — trackingGlobeViewer and theaterPlot usage
- `references/interpreter-categories.md` — Data model categories, state elements, and units
- `references/time-and-units.md` — Time parsing and unit conversion reference

----

Copyright 2026 The MathWorks, Inc.

More from matlab/matlab-agentic-toolkit

SkillDescription
matlab-access-datafeed>
matlab-add-awgnRead BEFORE writing any code that adds Additive White Gaussian Noise (AWGN) to signals and converts between SNR, Eb/No, Es/No, and per-subcarrier SNR for communications simulations, using awgn(), convertSNR(), berawgn(). The default MATLAB patterns for AWGN (e.g., 'measured' option, manual SNR formulas) produce subtly incorrect results. This skill specifies the correct calling conventions, required function usage, and critical anti-patterns that must be avoided.
matlab-analyze-ams-waveformAnalyze AMS waveform data using Mixed-Signal Blockset utilities: phase noise measurement, clock jitter, anti-aliased resampling, timing measurements, lock time, INL/DNL, ADC/DAC calibration, HSpice import. Use when analyzing time-domain voltage from PLL/VCO/clock simulations, measuring phase noise from variable-step solver output, computing jitter, or resampling non-uniform data.
matlab-analyze-dataAnalyze data using MATLAB. Use when the task involves tables, timetables, time-series data, numeric arrays, sensor matrices, or gridded data — including but not limited to exploring, filtering, sorting, cleaning, transforming, aggregating, smoothing, padding, trimming, and answering questions about data. MATLAB provides extensive, easy-to-use built-in functions for these workflows with no additional products required.
matlab-analyze-dependenciesAnalyze the effective toolbox file set to produce a Dependency Manifest — classify all transitive dependencies as included, product, add-on, or external-unresolved, then present resolution options with tradeoffs. Use after matlab-define-toolbox-api when the spec is approved.
matlab-analyze-emS-parameters, insertion loss, fields, currents, mesh control, and solver selection for RF PCB performance validation. TRIGGER: user asks to compute S-parameters, analyze insertion/return loss, extract fields or currents, compare MoM vs FEM, or control mesh for any RF PCB component. Invoke BEFORE writing sparameters() or solver code — API is non-obvious. SKIP: designing or creating components (use the specific matlab-design-pcb-* skill), material/stackup setup only (use matlab-manage-pcb-material), optimization sweeps (use matlab-optimize-pcb-design), PDN/IR-drop analysis (use matlab-analyze-pcb-pdn).
matlab-analyze-installed-antennaAnalyze antennas installed on electrically large conducting platforms using MATLAB Antenna Toolbox. Loads platform geometry from STL/STEP/IGES, installs antenna elements, selects electromagnetic solvers (MoM-PO, FMM, MoM), and computes patterns, impedance, coupling, and efficiency. Use when the user wants to model an antenna on a vehicle, aircraft, ship, satellite, or other large structure.
matlab-analyze-pcb-pdnPDN DC voltage/current analysis, IR drop, design rule checking, and multi-net batch analysis on imported PCB layouts. TRIGGER: user asks about power integrity, PDN analysis, IR drop, voltage distribution, current density, power nets, or design rule checking on a PCB. Invoke BEFORE writing code — the PDN API chain is specialized and non-obvious. SKIP: importing a PCB file (use matlab-read-pcb-layout), EM field/S-parameter extraction (use matlab-analyze-em), material/stackup setup only (use matlab-manage-pcb-material), transmission line design (use matlab-design-pcb-txline).
matlab-analyze-rcsCalculate and visualize monostatic and bistatic radar cross section (RCS) using MATLAB Antenna Toolbox. Computes RCS of platforms, antennas, and arrays with PO, MoM, and FMM solvers, supporting HH/VV/HV/VH polarization, GPU acceleration, and near-field observation. Use when the user wants to compute, plot, or analyze radar cross section.
matlab-analyze-rf-propagationAnalyze RF propagation and plan wireless sites using MATLAB Antenna Toolbox. Creates transmitter/receiver sites, computes signal strength, coverage maps, SINR, line-of-sight, and ray tracing in geographic or indoor environments. Supports multiple propagation models (free-space, close-in, Longley-Rice, ray tracing, rain/gas/fog), custom terrain, building data, and directional antennas. Use when the user wants to compute coverage, signal strength, path loss, SINR, ray tracing, or plan a wireless network.