Dataset
MATLAB code, Simulink model and LabVIEW VI datasets for AI training
A MATLAB code dataset is a set of MATLAB scripts, functions and toolboxes written inside an engineering group, usually delivered with the Simulink and Stateflow models, generated C code and LabVIEW programs that sit beside them, plus requirement links, simulation and test results and model review records. SourceX sources these on request from established automotive, aerospace, industrial and test-equipment engineering groups that built them, and reviews who owns each model and program. Each dataset is de-identified and licensed for an agreed permitted use.
Dataset manifest
Sourced to your spec- What it is
- MATLAB code, Simulink and Stateflow models, generated code and LabVIEW VIs with requirement links, test results and review records
- Typical systems
- MATLAB, Simulink, Stateflow, Embedded Coder, dSPACE TargetLink, Simulink Test, LabVIEW, NI TestStand
- Typical history
- Varies by holder; control models and test systems are revised for the life of a product or test stand, often across several tool releases
- Modality
- Source text; block diagrams in binary or XML containers, converted to graphs and images; test results as structured data
- Delivery formats
- Agreed per order; native M, SLX, MDL and VI files, diagrams as JSON graphs with rendered images, generated C, results as CSV or MAT-files
- Preparation
- Author names, hostnames, file paths and program names removed from metadata and comments; vendor-shipped libraries kept as references, not copied
- Licensing
- Scoped per model or test system; confirm export-control status and that toolbox and blockset vendor content is left out
- Availability
- Sourced to your spec from holders that agree to license; not guaranteed
What a delivery contains
Fields vary by source system and are fixed per order. A typical delivery includes:
| Field | Type | What it holds |
|---|---|---|
| artifact_id | string | Pseudonymous ID for one file or model, referenced by dependency, requirement and test records. |
| artifact_kind | enum | MATLAB function, script, class or live script, Simulink model or library, Stateflow chart, data dictionary, LabVIEW VI or test sequence. |
| container_format | object | On-disk format such as M, MLX, SLX, MDL or VI, the tool release that saved it, and whether its contents are readable or locked. |
| graph_export | object | The block diagram as nodes, ports, wires and nested subsystems or structures, with the conversion method used. |
| embedded_code | array | Text inside a diagram: MATLAB Function block bodies, Stateflow actions and conditions, formula nodes and S-function sources. |
| diagram_renders | array | One image per subsystem, chart or structure frame, keyed to the node IDs of the graph export. |
| dependencies | object | Referenced models, library links, toolboxes, drivers and initialization scripts, each marked in-house, vendor-shipped or unresolved. |
| workspace_data | object | Parameters, calibration tables, bus and enumeration definitions the model needs to compile, with withheld values marked. |
| execution_settings | object | Solver, step size, sample times and code generation target for models; execution target and hardware for VIs. |
| requirement_links | array | Links from a requirement ID to the block, chart state, function or test step that implements or verifies it. |
| generated_code | object | Generated C or HDL files with the generator, its configuration, the block-to-line trace map and hand edits flagged. |
| test_evidence | array | Test cases with harness, mode such as model-, software- or hardware-in-the-loop, inputs, limits, results and coverage. |
| review_records | array | Static check reports and peer review findings against the modeling guideline in force, with dispositions. |
| baseline | object | The release baseline or version-control tag the artifacts belong to, and the change request behind it. |
Field names from the table above; values are masked placeholders.
Example record
{
"artifact_id": "mdl_5e19a7",
"artifact_kind": "simulink_model",
"container_format": {"format": "SLX", "saved_in_release": "[RELEASE]", "readable": true},
"graph_export": {
"method": "in_tool_script",
"nodes": [
{"id": "n0", "type": "Constant", "name": "T_set_degC", "value": "T_Set"},
{"id": "n1", "type": "Inport", "name": "T_coolant_degC"},
{"id": "n2", "type": "Sum", "name": "temp_error", "inputs": "+-"},
{"id": "n3", "type": "SubSystem", "name": "PI_antiwindup", "children": 9},
{"id": "n4", "type": "Saturate", "name": "duty_limit", "upper": "DutyMax", "lower": "DutyMin"},
{"id": "n5", "type": "Chart", "name": "pump_mode", "states": ["Off", "Run", "Fault"]},
{"id": "n6", "type": "Outport", "name": "pump_duty_pct"}
],
"edges": [
["n0:1", "n2:1"],
["n1:1", "n2:2"],
["n2:1", "n3:1"],
["n3:1", "n4:1"],
["n4:1", "n5:1"],
["n5:1", "n6:1"]
]
},
"embedded_code": [
{"node": "n5", "kind": "stateflow_transition", "text": "[T_coolant_degC > T_FaultHi]"}
],
"diagram_renders": [{"node": "n5", "file": "mdl_5e19a7_n5.png"}],
"dependencies": {
"libraries": [
{"name": "ctrl_common_lib", "origin": "in_house"},
{"name": "simulink", "origin": "vendor_shipped", "delivered": false}
],
"init_script": "mfile_0c2d"
},
"workspace_data": {
"data_dictionary": "sldd_77b1",
"parameters": [{"name": "DutyMax", "value": 95}, {"name": "Kp", "value": "[WITHHELD]"}]
},
"execution_settings": {
"solver": "fixed_step_discrete",
"step_s": 0.01,
"codegen_target": "embedded_c"
},
"requirement_links": [
{
"req_id": "REQ-TH-0412",
"text": "Pump duty shall not exceed DutyMax in any mode.",
"implemented_by": ["n4", "n5"],
"verified_by": ["tc_0187"]
}
],
"generated_code": {
"files": ["coolant_pump_ctrl.c", "coolant_pump_ctrl.h"],
"entry_points": ["coolant_pump_ctrl_initialize", "coolant_pump_ctrl_step"],
"trace": [{"node": "n4", "file": "coolant_pump_ctrl.c", "lines": [142, 149]}],
"hand_edited": false
},
"test_evidence": [
{
"test_id": "tc_0187",
"mode": "back_to_back_mil_sil",
"tolerance": 0.001,
"result": "pass",
"model_coverage": {"decision": 1.0, "mcdc": 0.92}
}
],
"review_records": [
{
"type": "peer_review",
"finding": "Fault state commanded 100 percent downstream of duty_limit.",
"disposition": "chart output clamped to DutyMax"
}
],
"baseline": {"tag": "thermal_sw_2.3", "change_request": "cr_2291"}
}Synthetic record for illustration. Field names, structure and format are agreed per order.
What AI teams use it for
Teach models to read block diagrams
Graphs, rendered images and generated C give three views of one program for a model to align.
Train coding assistants for MATLAB and Simulink
In-house functions, scripts and model-building code show toolboxes and idioms as engineering teams use them.
Generate models from requirements
Requirements linked to the subsystems that implement them are worked examples of turning a statement into a design.
Review models against guidelines
Check reports and review findings with their fixes label what an experienced reviewer flags in a diagram.
Evaluate engineering agents
A change to a model can be graded by the archived test vectors and tolerances, not by resemblance to a reference answer.
Use-case guides: Coding agents, Private evaluation sets, Robotics and embodied AI
What makes this data valuable
Models that load
A model that compiles in its release, with no missing variables or broken links, can be exported.
Readable diagrams
Models and VIs saved with their diagrams present and unprotected can be converted.
Recorded trace links
Requirement, block, code line and test joined by tool records beat links inferred from names.
Tests with inputs and limits
Archived vectors, expected outputs and tolerances make each model executable evidence.
Review findings kept
Findings with dispositions show what was wrong and how it was fixed.
Baselines across releases
The same model at several baselines shows how a controller changed and why.
Process
MATLAB code dataset
Block diagrams have to be converted before a text model can read them
MATLAB functions and scripts are plain text. Little else here is. A Simulink model saved as SLX is a zip package of XML parts, with any Stateflow charts inside it. The older MDL format is a text file. A LabVIEW VI is a single binary file in a proprietary format, holding the front panel and the block diagram. Without the tool's own comparison feature, a version-control diff of an SLX or VI file shows that it changed, not what changed.
For Simulink there are three routes. Unpacking the SLX and reading its XML needs no license, but MathWorks warns that the internal contents of model files may change and points to its documented functions instead. The XML also mixes layout with meaning, may omit parameters left at their defaults, refers to library blocks by link, and names workspace variables without their values, so a gain reads as Kp, not as a number. Exporting from inside the tool works better: a script walks the model with find_system and get_param and writes every block, port and line as a graph, with links resolved and parameters evaluated. That needs the release and toolboxes the model was built with, so the holder runs it. The third route renders each subsystem and chart as an image keyed to the same node IDs.
For LabVIEW the practical route runs through LabVIEW itself, where VI Scripting can walk a diagram's nodes, wires and structures. A Case Structure shows one frame at a time, so a screenshot hides the rest and an export has to visit every frame. A VI saved with its diagram removed holds nothing to convert, and one locked by password needs the holder to open it. In both tools execution order follows data dependencies, and in Simulink sample times too, not position on the canvas, so the export must keep ports and wires. A left-to-right listing of blocks is not the program.
Requirement, model, generated code and test form one chain
In model-based design the model is the source. Engineers edit the block diagram and state chart, and a code generator such as Embedded Coder or TargetLink writes the C that runs on the controller. The generated code for a model typically has an initialization function and a step function, data structures for inputs, outputs and states, and comments naming the block each statement came from. Where the generator wrote a traceability report, the map from block to code line is recorded, not inferred.
The chain extends both ways. Upstream, requirements kept in a requirements tool are linked to the subsystems and chart states that implement them. Downstream, the same test vectors run against the model, against the generated code compiled on a workstation, and against the code on the target processor, and outputs are compared back to back within a tolerance. Safety standards such as ISO 26262 for road vehicles, and DO-178C with its model-based supplement DO-331 for airborne software, call for this traceability, so teams working to them keep it. Hand-written code offers a commit message and, with luck, a ticket.
Generated C is not independent volume. It is a function of the model, the generator configuration and the tool release, so count models and requirements, not lines. The chain also breaks in known places: requirement links that point into a database that was not delivered, test harnesses archived apart from the baseline, generated files patched by hand, and regeneration under a newer release. LabVIEW test systems have a shorter chain: a test specification with limits, a sequence, and measured results per unit. Ask how many sample requirements trace through to a passing test.
What to check before licensing
- Count unreadable sample files: P-code, protected Simulink models, compiled MEX files, and VIs saved without diagrams or locked by password.
- Ask which release and toolboxes each model needs, and for a log showing sample models compile with no unresolved library links or missing workspace variables.
- Compare block and wire counts between a native model and its graph export, and check that masked subsystems, chart contents and every case frame were visited.
- Follow sample requirements to their blocks, generated code lines and test results, counting where the chain breaks.
- Ask whether generated code was edited by hand after generation, and whether the generator configuration was archived with each baseline.
- Ask the holder for each program's export-control classification and have export-control counsel or compliance staff review it before accepting aerospace or defense models. Confirm who owns customer-supplied plant models and calibrations.
- Get a list of excluded vendor content and check the sample for shipped toolbox files, vendor blocksets, driver libraries and vendor examples copied into in-house folders.
Delivery No files move before a signed license. A listing or a request grants no files by itself.
How licensing works through SourceX
- 1
Define
Send the domain, modality, volume, format, timeline and permitted use you need.
- 2
Source
SourceX identifies businesses that hold matching data and are open to licensing it.
- 3
Qualify
Fit, rights and quality are checked, and you review samples before committing.
- 4
License
Scope, permitted use, exclusivity, price and obligations are agreed in writing.
- 5
Deliver
Approved data is prepared, de-identified where required and transferred securely.
Questions Acquisition Partners ask
Can a language model read a Simulink or LabVIEW file directly?
Not usefully. An SLX file is a zip of XML that mixes layout with logic, and a LabVIEW VI is a binary in a proprietary format. Both need converting to a graph of blocks, ports and wires, ideally exported from inside the tool. Ask for the native file, the graph and rendered images together.
Do we need MATLAB or LabVIEW licenses to use the delivery?
Not to read it, if conversion is part of the order. Graph exports, images, MATLAB source and generated C are ordinary files. To simulate a model or run a VI you need the tool, the release it was saved in, the toolboxes it calls and, for test programs, the instruments. Ask the holder to list those per model.
Is the generated C code worth including?
Yes, as a paired view of the model and not as extra code. Generated C shows how a diagram becomes statements, and its comments usually name the source block. It repeats the model's information in a generator's style, so do not count it as independent volume. Ask for hand-written files, such as drivers and wrappers, to be labeled.
How are toolbox and vendor library blocks handled?
They stay as references. A model normally links to the vendor's block libraries, and a VI calls the vendor's shipped VIs by path. Shipped toolbox source, third-party blocksets and instrument drivers belong to their vendors. Ask for a list of what was excluded, and check the sample for copied vendor files.
Can aerospace and defense models be licensed?
Sometimes, and only after an export-control check that you should run yourself. A flight control or guidance model can be controlled technical data whatever its file format. Ask the holder for each program's classification, involve export-control counsel or your compliance staff before any sample moves, and consider limiting the request to automotive or industrial programs.
What comes with LabVIEW test programs?
Typically the VIs, the project and library files, type definitions and, where the holder used TestStand, the sequence files that call them. Result logs with step name, measured value, limits and pass or fail are the most useful companion. The programs depend on drivers and physical instruments, so most will not run as delivered.
Related datasets
- Scientific and HPC simulation codebases
Private simulation and numerical source with build files, input decks, job scripts, validation cases, reference results and scaling runs
- Embedded firmware codebases with hardware documents
Firmware source paired to the hardware documents, build description and test evidence it depends on
- PLC and ladder logic programs
Controller programs in ladder, structured text and function blocks with tag lists, I/O maps, HMI screens and design documents
- CAD and PCB engineering files with revision history
Native CAD and ECAD design files with revisions, change orders and BOMs
- Legacy and rare-language codebases
Private production code in under-represented languages, with copybooks, job control, data definitions and change history
Evaluating this data for procurement?
Diligence packets are prepared per dataset. Rights, privacy processing and quality differ between datasets.
Request dataset diligenceTell us what your models need
Send your spec — domain, volume, format, timeline and permitted use — and SourceX will match it against partner data and come back with what can be licensed.
Updated 25 November 2026.