create-sdi-run

Import logged data into the Simulation Data Inspector from files, workspace variables, or simulations.

1.0k|98|Updated Apr 15, 2026
One-click install
npx skills add https://github.com/matlab/simulink-agentic-toolkit --skill create-sdi-run
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: create-sdi-run
Source: https://github.com/matlab/simulink-agentic-toolkit/tree/main/skills-catalog/simulink-simulation/create-sdi-run
Command: npx skills add https://github.com/matlab/simulink-agentic-toolkit --skill create-sdi-run

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Getting logged data into Simulink's Simulation Data Inspector (SDI) is error-prone: agents often manually read MAT/CSV/Excel files and rebuild signals by hand, create duplicate runs after sim(), or hit cryptic import errors from misnamed time columns. This Skill encodes the direct Simulink.sdi.createRun paths and the verification steps that prevent silent failures.

Core Features & Use Cases

  • File import in one call: Load .mat, .csv, and .xlsx files directly via the 'file' source, including multi-sheet Excel workbooks that return one run per sheet.
  • Workspace variable import: Use 'vars' for named timeseries/timetable data or 'namevalue' for bare arrays, with guidance on the timeseries.Name precedence gotcha.
  • Post-simulation handling: Detect SDI auto-population after sim(model) using getAllRunIDs to avoid duplicate runs, and verify every import with SignalCount checks.
  • Use Case: A user has a bench-test log bench_run.csv whose time column is named Timestamp. The Skill tries the direct file import, catches SDI:sdi:ImportError, and falls back to a readmatrix + array2timetable + 'vars' pattern without modifying the source file.

Quick Start

Ask your agent to import the file 'logs/bench_test.mat' into the Simulation Data Inspector and verify the run's signal count.

Frequently Asked Questions about create-sdi-run

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I import a CSV or MAT file into the Simulation Data Inspector?

Use Simulink.sdi.createRun with the 'file' source, for example Simulink.sdi.createRun("run","file","logs/data.csv"). This handles MAT, CSV, and Excel natively without calling load or readtable yourself.

How do I view logged signals in SDI after running sim(model)?

If signal logging is enabled, sim(model) auto-populates an SDI run, so just call Simulink.sdi.view. Check Simulink.sdi.getAllRunIDs before and after sim to confirm a new run appeared instead of calling createRun, which would duplicate it.

Why does SDI CSV import fail with SDI:sdi:ImportError?

SDI's built-in CSV reader requires the time column to be named literally 'time' (case-insensitive); headers like 't' or 'Timestamp' fail. Catch the error and fall back to readmatrix plus array2timetable, then import via the 'vars' source.

What file formats can the Simulation Data Inspector read natively?

SDI natively reads .mat, .csv, .xlsx, and .xls files with no extra toolbox. MDF, ULG, and ROS bag formats need specific toolboxes, while CAN logs and HDF5 require conversion to a timetable first.

Why does my Excel import create multiple SDI runs with the same name?

createRun with an Excel file returns one run per sheet, and all runs inherit the base name you passed. Rename each run in place using Simulink.sdi.getRun(runIDs(k)).Name with the sheet names rather than deleting and re-importing.

When should I not use Simulink.sdi.createRun?

Do not use it for comparing existing runs (use Simulink.sdi.compareRuns), for streaming data during a running simulation (use createRunOrAddToStreamedRun), or for authoring test cases and assertions, which belong to a testing workflow.